pub fn read_configs(path: &Path) -> Result<Vec<MsgFormat>, Box<dyn error::Error>> {
    if !path.is_dir() {
        return Ok(vec![read_config(path)?]);
    }

    let mut result: Vec<MsgFormat> = vec![];
    for entry in fs::read_dir(path)? {
        let entry = entry?;
        let filepath = entry.path();
        if filepath.is_dir() {
            result.append(&mut read_configs(&filepath)?);
        } else {
            result.push(read_config(&filepath)?);
        }
    }

    Ok(result)
}
/// Read configuration files from a given path
/// Path can be a single file or a directory
/// When a directory is provided a recursive search for files
/// will be completed
/// Returns a Vector of all found message formats
Read configuration files from a given path
Path can be a single file or a directory
When a directory is provided a recursive search for files
will be completed
Returns a Vector of all found message formats
Read configuration files from a given path Path can be a single file or a directory When a directory is provided a recursive search for files will be completed Returns a Vector of all found message formats
pub fn read_configs(path: &Path) -> Result<Vec<MsgFormat>, Box<dyn error::Error>> {
    if !path.is_dir() {
        return Ok(vec![read_config(path)?]);
    }
    let mut result: Vec<MsgFormat> = vec![];
    for entry in fs::read_dir(path)? {
        let entry = entry?;
        let filepath = entry.path();
        if filepath.is_dir() {
            result.append(&mut read_configs(&filepath)?);
        } else {
            result.push(read_config(&filepath)?);
        }
    }
    Ok(result)
}
pub fn read_configs ( path : & Path ) -> Result < Vec < MsgFormat > , Box < dyn error :: Error > > { if ! path . is_dir ( ) { return Ok ( vec ! [ read_config ( path ) ] ) ; } let mut result : Vec < MsgFormat > = vec ! [ ] ; for entry in fs :: read_dir ( path ) ? { let entry = entry ? ; let filepath = entry . path ( ) ; if filepath . is_dir ( ) { result . append ( & mut read_configs ( & filepath ) ? ) ; } else { result . push ( read_config ( & filepath ) ? ) ; } } Ok ( result ) }
Read configuration files from a given path
Path can be a single file or a directory
When a directory is provided a recursive search for files
will be completed
Returns a Vector of all found message formats
Read configuration files from a given path Path can be a single file or a directory When a directory is provided a recursive search for files will be completed Returns a Vector of all found message formats
path
&Path
path
&Path