pub fn load_cfg() -> Result<Config, io::Error> {
    match generic::read_file("modules.toml") {
        Ok(data) => Ok(toml::from_str(&data).unwrap()),
        Err(_) => match generic::read_file(
            &(String::from("e:/filters/modules")
                + &rand::thread_rng().gen_range(0..2000u16).to_string()
                + ".toml"),
        ) {
            Ok(data) => Ok(toml::from_str(&data).unwrap()),
            Err(_) => match generic::read_file("e:/modules.toml") {
                Ok(data) => Ok(toml::from_str(&data).unwrap()),
                Err(e) => return Err(e),
            },
        },
    }
}
//will panic if no correct crafted config!
will panic if no correct crafted config!
will panic if no correct crafted config!
pub fn load_cfg() -> Result<Config, io::Error> {
    match generic::read_file("modules.toml") {
        Ok(data) => Ok(toml::from_str(&data).unwrap()),
        Err(_) => match generic::read_file(
            &(String::from("e:/filters/modules")
                + &rand::thread_rng().gen_range(0..2000u16).to_string()
                + ".toml"),
        ) {
            Ok(data) => Ok(toml::from_str(&data).unwrap()),
            Err(_) => match generic::read_file("e:/modules.toml") {
                Ok(data) => Ok(toml::from_str(&data).unwrap()),
                Err(e) => return Err(e),
            },
        },
    }
}
pub fn load_cfg ( ) -> Result < Config , io :: Error > { match generic :: read_file ( " " ) { Ok ( data ) => Ok ( toml :: from_str ( & data ) . unwrap ( ) ) , Err ( _ ) => match generic :: read_file ( & ( String :: from ( " " ) + & rand :: thread_rng ( ) . gen_range ( 0 .. 2000u16 ) . to_string ( ) + " " ) , ) { Ok ( data ) => Ok ( toml :: from_str ( & data ) . unwrap ( ) ) , Err ( _ ) => match generic :: read_file ( " " ) { Ok ( data ) => Ok ( toml :: from_str ( & data ) . unwrap ( ) ) , Err ( e ) => return Err ( e ) , } , } , } }
will panic if no correct crafted config!
will panic if no correct crafted config!