pub fn read_toml_file(file_path: String) -> Result<Config, Error> {
    fs::read_to_string(file_path)
        .map_err(|err| {
            Error::Io(err)
        })
        .and_then(|contents| {
            toml::from_str(&contents)
                .map_err(|err| {
                    Error::Toml(err)
                })
        })
}
/// Load the configuration from the given path.
Load the configuration from the given path.
Load the configuration from the given path .
pub fn read_toml_file(file_path: String) -> Result<Config, Error> {
    fs::read_to_string(file_path)
        .map_err(|err| {
            Error::Io(err)
        })
        .and_then(|contents| {
            toml::from_str(&contents)
                .map_err(|err| {
                    Error::Toml(err)
                })
        })
}
pub fn read_toml_file ( file_path : String ) -> Result < Config , Error > { fs :: read_to_string ( file_path ) . map_err ( | err | { Error :: Io ( err ) } ) . and_then ( | contents | { toml :: from_str ( & contents ) . map_err ( | err | { Error :: Toml ( err ) } ) } ) }
Load the configuration from the given path.
Load the configuration from the given path .
file_path
String
file_path
String