pub fn load(path: impl AsRef<Path>) -> Result<Config, Error> {
    let config_toml = std::fs::read_to_string(&path).map_err(Error::io)?;

    let config = toml::from_str::<Config>(&config_toml[..]).map_err(Error::decode)?;

    Ok(config)
}
/// Attempt to load and parse the TOML config file as a `Config`.
Attempt to load and parse the TOML config file as a `Config`.
Attempt to load and parse the TOML config file as a ` Config ` .
pub fn load(path: impl AsRef<Path>) -> Result<Config, Error> {
    let config_toml = std::fs::read_to_string(&path).map_err(Error::io)?;
    let config = toml::from_str::<Config>(&config_toml[..]).map_err(Error::decode)?;
    Ok(config)
}
pub fn load ( path : impl AsRef < Path > ) -> Result < Config , Error > { let config_toml = std :: fs :: read_to_string ( & path ) . map_err ( Error :: io ) ? ; let config = toml :: from_str :: < Config > ( & config_toml [ .. ] ) . map_err ( Error :: decode ) ? ; Ok ( config ) }
Attempt to load and parse the TOML config file as a `Config`.
Attempt to load and parse the TOML config file as a ` Config ` .
path
impl AsRef<Path>
path
impl AsRef<Path>