pub fn read(toml_file: impl AsRef<Path>) -> io::Result<Config> {
    let buffer = fs::read_to_string(&toml_file)?;

    // initial parse.
    let config: Config = match toml::from_str(&buffer) {
        Ok(v) => Ok(v),
        Err(e) => Err(io::Error::new(io::ErrorKind::InvalidData, e.to_string())),
    }?;

    Ok(config)
}
// Read the TOML config into a config::Config struct.
Read the TOML config into a config::Config struct.
Read the TOML config into a config :: Config struct .
pub fn read(toml_file: impl AsRef<Path>) -> io::Result<Config> {
    let buffer = fs::read_to_string(&toml_file)?;
    // initial parse.
    let config: Config = match toml::from_str(&buffer) {
        Ok(v) => Ok(v),
        Err(e) => Err(io::Error::new(io::ErrorKind::InvalidData, e.to_string())),
    }?;
    Ok(config)
}
pub fn read ( toml_file : impl AsRef < Path > ) -> io :: Result < Config > { let buffer = fs :: read_to_string ( & toml_file ) ? ; // initial parse. let config : Config = match toml :: from_str ( & buffer ) { Ok ( v ) => Ok ( v ) , Err ( e ) => Err ( io :: Error :: new ( io :: ErrorKind :: InvalidData , e . to_string ( ) ) ) , } ? ; Ok ( config ) }
Read the TOML config into a config::Config struct.
Read the TOML config into a config :: Config struct .
toml_file
impl AsRef<Path>