pub fn from_file(path: &Path) -> Result<Config, ConfigError> {
    let mut file = match File::open(path) {
        Ok(f) => f,
        Err(e) => return Err(from_io_err(e))
    };
    from_stream(&mut file)
}
/// Reads a configuration from a UTF-8 file.
/// Errors can be caused by:
///
/// * An error when trying to locate / open the file. This is treated as an I/O error.
/// * A syntax error
///
/// Errors upon opening the file can happen due to the file not existing, or bad permissions, etc.
///
/// # Examples
/// This reads and parses a configuration stored in `examples/sample.conf`:
///
/// ```
/// use std::path::Path;
///
/// use config::reader::from_file;
///
/// let parsed = from_file(Path::new("tests/sample.conf"));
/// assert!(parsed.is_ok());
/// ```
///
Reads a configuration from a UTF-8 file.
Errors can be caused by.

An error when trying to locate / open the file. This is treated as an I/O error.
A syntax error

Errors upon opening the file can happen due to the file not existing, or bad permissions, etc.
Reads a configuration from a UTF - 8 file . Errors can be caused by . An error when trying to locate / open the file . This is treated as an I / O error . A syntax error Errors upon opening the file can happen due to the file not existing or bad permissions etc .
pub fn from_file(path: &Path) -> Result<Config, ConfigError> {
    let mut file = match File::open(path) {
        Ok(f) => f,
        Err(e) => return Err(from_io_err(e))
    };
    from_stream(&mut file)
}
pub fn from_file ( path : & Path ) -> Result < Config , ConfigError > { let mut file = match File :: open ( path ) { Ok ( f ) => f , Err ( e ) => return Err ( from_io_err ( e ) ) } ; from_stream ( & mut file ) }
Reads a configuration from a UTF-8 file.
Reads a configuration from a UTF - 8 file .
path
&Path
path
&Path
examples
This reads and parses a configuration stored in `examples/sample.conf`.



use config::reader::from_file.

let parsed = from_file(Path::new("tests/sample.conf"));
assert!(parsed.is_ok());
```
This reads and parses a configuration stored in ` examples / sample . conf ` . use config :: reader :: from_file . let parsed = from_file ( Path :: new ( " tests / sample . conf " )) ; assert! ( parsed . is_ok () ) ; ` ` `