// Function to read in the TOML file and output a configuration structure
Function to read in the TOML file and output a configuration structure
Function to read in the TOML file and output a configuration structure
fn read_config(config_file: PathBuf) -> Config {
    // Read in the config file, extract the parameters and return the config object
    let mut a_file = File::open(config_file).expect("not found");
    let mut contents = String::new();
    a_file.read_to_string(&mut contents).expect("could not read file");
    // Use serde toml to deserialize
    let config: Config = toml::from_str(&contents).expect("could not unpack toml");
    config
}
fn read_config ( config_file : PathBuf ) -> Config { // Read in the config file, extract the parameters and return the config object let mut a_file = File :: open ( config_file ) . expect ( " " ) ; let mut contents = String :: new ( ) ; a_file . read_to_string ( & mut contents ) . expect ( " " ) ; // Use serde toml to deserialize let config : Config = toml :: from_str ( & contents ) . expect ( " " ) ; config }
Function to read in the TOML file and output a configuration structure
Function to read in the TOML file and output a configuration structure
config_file
PathBuf