pub fn read_config_file() -> Config {
    // Open the file in read-only mode with buffer.
    // let file = File::open(CONFIG_FILE).expect("Unable to read file!");
    let file = File::open(CONFIG_FILE);

    let file = match file {
        Ok(file) => file,
        Err(error) => panic!("Problem with opening the file: {:?}", error),
    };

    let reader = BufReader::new(file);

    // Read the JSON contents of the file as an instance of `Config`.
    let config: Config = serde_json::from_reader(reader).expect("Unable to parse string to json!");

    return config;
}
/// Read config file and return config
Read config file and return config
Read config file and return config
pub fn read_config_file() -> Config {
    // Open the file in read-only mode with buffer.
    // let file = File::open(CONFIG_FILE).expect("Unable to read file!");
    let file = File::open(CONFIG_FILE);
    let file = match file {
        Ok(file) => file,
        Err(error) => panic!("Problem with opening the file: {:?}", error),
    };
    let reader = BufReader::new(file);
    // Read the JSON contents of the file as an instance of `Config`.
    let config: Config = serde_json::from_reader(reader).expect("Unable to parse string to json!");
    return config;
}
pub fn read_config_file ( ) -> Config { // Open the file in read-only mode with buffer. // let file = File::open(CONFIG_FILE).expect("Unable to read file!"); let file = File :: open ( CONFIG_FILE ) ; let file = match file { Ok ( file ) => file , Err ( error ) => panic ! ( " " error ) , } ; let reader = BufReader :: new ( file ) ; // Read the JSON contents of the file as an instance of `Config`. let config : Config = serde_json :: from_reader ( reader ) . expect ( " " ) ; return config ; }
Read config file and return config
Read config file and return config