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"))
};
