summaryrefslogtreecommitdiffstats
path: root/src/known_stars.rs
blob: cf78aa21be9a1ad48d510f63a0536fa215d4de01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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"))
};