diff options
Diffstat (limited to 'src/known_stars.rs')
| -rw-r--r-- | src/known_stars.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/known_stars.rs b/src/known_stars.rs new file mode 100644 index 0000000..cf78aa2 --- /dev/null +++ b/src/known_stars.rs @@ -0,0 +1,24 @@ +use phf::phf_map; +use std::fmt; +use std::error::Error; + +#[derive(Debug)] +pub struct StarNotFoundError +{ + pub star: &'static str +} + +impl fmt::Display for StarNotFoundError { + fn fmt( + &self, + f: &mut fmt::Formatter<'_>) + -> fmt::Result { + write!(f, "Star {:0} is not known!", self.star) + } +} + +impl Error for StarNotFoundError {} + +pub static KNOWN_STARS: phf::Map<&'static str, &'static str> = phf_map! { + "sol" => include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/systems/sol.csv")) +}; |
