fn load_config<P: AsRef<Path>>(path: P) -> Self {
        let path = path.as_ref();
        let mut file =
            File::open(path).unwrap_or_else(|_| panic!("Cannot open config file {:?}", path));
        let mut contents = String::new();
        file.read_to_string(&mut contents)
            .unwrap_or_else(|_| panic!("Error reading config file {:?}", path));
        Self::parse(&contents).expect("Unable to parse config")
    }
// TODO: Return Result<Self> instead of panic.
Return Result instead of panic.
Return Result instead of panic .
fn load_config<P: AsRef<Path>>(path: P) -> Self {
        let path = path.as_ref();
        let mut file =
            File::open(path).unwrap_or_else(|_| panic!("Cannot open config file {:?}", path));
        let mut contents = String::new();
        file.read_to_string(&mut contents)
            .unwrap_or_else(|_| panic!("Error reading config file {:?}", path));
        Self::parse(&contents).expect("Unable to parse config")
    }
fn load_config < P : AsRef < Path > > ( path : P ) -> Self { let path = path . as_ref ( ) ; let mut file = File :: open ( path ) . unwrap_or_else ( | _ | panic ! ( " " path ) ) ; let mut contents = String :: new ( ) ; file . read_to_string ( & mut contents ) . unwrap_or_else ( | _ | panic ! ( " " path ) ) ; Self :: parse ( & contents ) . expect ( " " ) }
TODO: Return Result<Self> instead of panic.
TODO : Return Result<Self > instead of panic .
path
P