pub fn load_config_file<T, P>(config_file: P) -> Result<T, io::Error>
where
    T: serde::de::DeserializeOwned,
    P: AsRef<Path>,
{
    let file = File::open(config_file)?;
    let config = serde_yaml::from_reader(file)
        .map_err(|err| io::Error::new(io::ErrorKind::Other, format!("{:?}", err)))?;
    Ok(config)
}
/// Load a value from a file in YAML format.
///
/// Despite the name, this function is generic YAML file deserializer, a thin
/// wrapper around serde.
///
/// Most callers should instead use [`Config::load`].
///
/// # Errors
///
/// This function may return typical file I/O errors.
Load a value from a file in YAML format.
Despite the name, this function is generic YAML file deserializer, a thin
wrapper around serde.

Most callers should instead use [`Config::load`].
Load a value from a file in YAML format . Despite the name this function is generic YAML file deserializer a thin wrapper around serde . Most callers should instead use [ ` Config :: load ` ] .
pub fn load_config_file<T, P>(config_file: P) -> Result<T, io::Error>
where
    T: serde::de::DeserializeOwned,
    P: AsRef<Path>,
{
    let file = File::open(config_file)?;
    let config = serde_yaml::from_reader(file)
        .map_err(|err| io::Error::new(io::ErrorKind::Other, format!("{:?}", err)))?;
    Ok(config)
}
pub fn load_config_file < T , P > ( config_file : P ) -> Result < T , io :: Error > where T : serde :: de :: DeserializeOwned , P : AsRef < Path > , { let file = File :: open ( config_file ) ? ; let config = serde_yaml :: from_reader ( file ) . map_err ( | err | io :: Error :: new ( io :: ErrorKind :: Other , format ! ( " " err ) ) ) ? ; Ok ( config ) }
Load a value from a file in YAML format.
Load a value from a file in YAML format .
config_file
P
errors
This function may return typical file I/O errors.
This function may return typical file I / O errors .