Rename Skyvector to SkyVector

This commit is contained in:
Austen Adler 2023-04-23 17:12:33 -04:00
parent 110d562630
commit e32e8e00ee
4 changed files with 17 additions and 17 deletions

View File

@ -7,7 +7,7 @@ use crate::{
dmm, dmm,
dms, dms,
plus, //xpin plus, //xpin
skyvector, sky_vector,
utm, utm,
Coordinate, Coordinate,
Error, Error,
@ -26,7 +26,7 @@ pub struct Coordinates {
pub utm: utm::Coordinate, pub utm: utm::Coordinate,
// pub xpin: xpin::Xpin, // pub xpin: xpin::Xpin,
pub plus: plus::Coordinate, pub plus: plus::Coordinate,
pub skyvector: skyvector::Coordinate, pub sky_vector: sky_vector::Coordinate,
} }
impl TryFrom<LatLon> for Coordinates { impl TryFrom<LatLon> for Coordinates {
@ -40,7 +40,7 @@ impl TryFrom<LatLon> for Coordinates {
dmm: dmm::Coordinate::from(latlon), dmm: dmm::Coordinate::from(latlon),
utm: utm::Coordinate::try_from(latlon)?, utm: utm::Coordinate::try_from(latlon)?,
plus: plus::Coordinate::try_from(latlon)?, plus: plus::Coordinate::try_from(latlon)?,
skyvector: skyvector::Coordinate::from(latlon), sky_vector: sky_vector::Coordinate::from(latlon),
}) })
} }
} }

View File

@ -6,7 +6,7 @@ pub mod dmm;
pub mod dms; pub mod dms;
pub mod latlon; pub mod latlon;
pub mod plus; pub mod plus;
pub mod skyvector; pub mod sky_vector;
pub mod urls; pub mod urls;
pub mod utm; pub mod utm;
pub use error::Error; pub use error::Error;
@ -88,7 +88,7 @@ pub enum Coordinate {
UTM(utm::Coordinate), UTM(utm::Coordinate),
// Xpin(xpin::Xpin), // Xpin(xpin::Xpin),
Plus(plus::Coordinate), Plus(plus::Coordinate),
Skyvector(skyvector::Coordinate), SkyVector(sky_vector::Coordinate),
} }
impl Coordinate { impl Coordinate {
@ -108,7 +108,7 @@ impl Coordinate {
map(dd::Coordinate::parse, Coordinate::DD), map(dd::Coordinate::parse, Coordinate::DD),
// map(xpin::Coordinate::parse, Cordinate::Xpin), // map(xpin::Coordinate::parse, Cordinate::Xpin),
map(plus::Coordinate::parse, Coordinate::Plus), map(plus::Coordinate::parse, Coordinate::Plus),
map(skyvector::Coordinate::parse, Coordinate::Skyvector), map(sky_vector::Coordinate::parse, Coordinate::SkyVector),
// Try to parse as a URL last // Try to parse as a URL last
map(urls::CoordinateUrls::parse, |coordinate_urls| { map(urls::CoordinateUrls::parse, |coordinate_urls| {
Coordinate::DD(dd::Coordinate::from(coordinate_urls.latlon)) Coordinate::DD(dd::Coordinate::from(coordinate_urls.latlon))
@ -130,7 +130,7 @@ impl Coordinate {
CoordinateType::DMM => Self::DMM(dmm::Coordinate::from(lat_lon)), CoordinateType::DMM => Self::DMM(dmm::Coordinate::from(lat_lon)),
CoordinateType::UTM => Self::UTM(utm::Coordinate::try_from(lat_lon)?), CoordinateType::UTM => Self::UTM(utm::Coordinate::try_from(lat_lon)?),
CoordinateType::Plus => Self::Plus(plus::Coordinate::try_from(lat_lon)?), CoordinateType::Plus => Self::Plus(plus::Coordinate::try_from(lat_lon)?),
CoordinateType::Skyvector => Self::Skyvector(skyvector::Coordinate::from(lat_lon)), CoordinateType::SkyVector => Self::SkyVector(sky_vector::Coordinate::from(lat_lon)),
}) })
} }
@ -142,7 +142,7 @@ impl Coordinate {
Self::UTM(_) => CoordinateType::UTM, Self::UTM(_) => CoordinateType::UTM,
// Self::Xpin(_) => CoordinateType::Xpin, // Self::Xpin(_) => CoordinateType::Xpin,
Self::Plus(_) => CoordinateType::Plus, Self::Plus(_) => CoordinateType::Plus,
Self::Skyvector(_) => CoordinateType::Skyvector, Self::SkyVector(_) => CoordinateType::SkyVector,
} }
} }
} }
@ -162,7 +162,7 @@ impl From<&Coordinate> for LatLon {
Coordinate::UTM(utm) => utm.into(), Coordinate::UTM(utm) => utm.into(),
// Coordinate::Xpin(xpin) => xpin.into(), // Coordinate::Xpin(xpin) => xpin.into(),
Coordinate::Plus(plus) => plus.into(), Coordinate::Plus(plus) => plus.into(),
Coordinate::Skyvector(skyvector) => skyvector.into(), Coordinate::SkyVector(sky_vector) => sky_vector.into(),
} }
} }
} }
@ -206,9 +206,9 @@ impl From<plus::Coordinate> for Coordinate {
Self::Plus(c) Self::Plus(c)
} }
} }
impl From<skyvector::Coordinate> for Coordinate { impl From<sky_vector::Coordinate> for Coordinate {
fn from(c: skyvector::Coordinate) -> Self { fn from(c: sky_vector::Coordinate) -> Self {
Self::Skyvector(c) Self::SkyVector(c)
} }
} }
@ -245,7 +245,7 @@ impl fmt::Display for Coordinate {
Coordinate::DMS(dms) => write!(f, "{}", dms), Coordinate::DMS(dms) => write!(f, "{}", dms),
Coordinate::UTM(utm) => write!(f, "{}", utm), Coordinate::UTM(utm) => write!(f, "{}", utm),
Coordinate::Plus(plus) => write!(f, "{}", plus), Coordinate::Plus(plus) => write!(f, "{}", plus),
Coordinate::Skyvector(skyvector) => write!(f, "{}", skyvector), Coordinate::SkyVector(sky_vector) => write!(f, "{}", sky_vector),
} }
} }
} }

View File

@ -96,7 +96,7 @@ impl Coordinate {
) )
} }
pub fn get_skyvector(&self) -> &str { pub fn get_sky_vector(&self) -> &str {
&self.0 &self.0
} }
} }

View File

@ -74,8 +74,8 @@ pub struct Coordinates {
// pub xpin: String, // pub xpin: String,
#[wasm_bindgen(js_name = "Plus")] #[wasm_bindgen(js_name = "Plus")]
pub plus: String, pub plus: String,
#[wasm_bindgen(js_name = "Skyvector")] #[wasm_bindgen(js_name = "SkyVector")]
pub skyvector: String, pub sky_vector: String,
} }
impl From<&spatial_coordinate_systems::all::Coordinates> for Coordinates { impl From<&spatial_coordinate_systems::all::Coordinates> for Coordinates {
@ -86,7 +86,7 @@ impl From<&spatial_coordinate_systems::all::Coordinates> for Coordinates {
dmm: value.dmm.to_string(), dmm: value.dmm.to_string(),
utm: value.utm.to_string(), utm: value.utm.to_string(),
plus: value.plus.to_string(), plus: value.plus.to_string(),
skyvector: value.skyvector.to_string(), sky_vector: value.sky_vector.to_string(),
} }
} }
} }