pub fn from_file(config: &str) -> Result<Config, ConfigError> {
        let mut f = File::open(&Path::new(config))?;
        let mut conf:String = "".to_string();
        f.read_to_string(&mut conf)?;
        let mut parser = Parser::new(&conf);
        match parser.parse() {
            Some(t) => Ok(Config {
                            config: Value::Table(t)
                        }),
            None => Err(ConfigError::TomlParseError(parser.errors))
        }
    }
///! Create config from a toml file
Create config from a toml file
Create config from a toml file
pub fn from_file(config: &str) -> Result<Config, ConfigError> {
        let mut f = File::open(&Path::new(config))?;
        let mut conf:String = "".to_string();
        f.read_to_string(&mut conf)?;
        let mut parser = Parser::new(&conf);
        match parser.parse() {
            Some(t) => Ok(Config {
                            config: Value::Table(t)
                        }),
            None => Err(ConfigError::TomlParseError(parser.errors))
        }
    }
pub fn from_file ( config : & str ) -> Result < Config , ConfigError > { let mut f = File :: open ( & Path :: new ( config ) ) ? ; let mut conf : String = " " . to_string ( ) ; f . read_to_string ( & mut conf ) ? ; let mut parser = Parser :: new ( & conf ) ; match parser . parse ( ) { Some ( t ) => Ok ( Config { config : Value :: Table ( t ) } ) , None => Err ( ConfigError :: TomlParseError ( parser . errors ) ) } }
Create config from a toml file
Create config from a toml file
config
&str
config
&str