pub fn dir_read(target: &str) -> errors::Result<Vec<String>> {
    let path = PathBuf::from(target);
    let contents = fs::read_dir(path).chain_err(|| "failed reading directory contents")?;

    let mut res: Vec<String> = Vec::new();

    for ele in contents {
        let el = ele.unwrap().file_name().into_string().unwrap();
        res.push(el);
    }

    Ok(res)
}
// read all entry inside a dir.
read all entry inside a dir.
read all entry inside a dir .
pub fn dir_read(target: &str) -> errors::Result<Vec<String>> {
    let path = PathBuf::from(target);
    let contents = fs::read_dir(path).chain_err(|| "failed reading directory contents")?;
    let mut res: Vec<String> = Vec::new();
    for ele in contents {
        let el = ele.unwrap().file_name().into_string().unwrap();
        res.push(el);
    }
    Ok(res)
}
pub fn dir_read ( target : & str ) -> errors :: Result < Vec < String > > { let path = PathBuf :: from ( target ) ; let contents = fs :: read_dir ( path ) . chain_err ( | | " " ) ? ; let mut res : Vec < String > = Vec :: new ( ) ; for ele in contents { let el = ele . unwrap ( ) . file_name ( ) . into_string ( ) . unwrap ( ) ; res . push ( el ) ; } Ok ( res ) }
read all entry inside a dir.
read all entry inside a dir .
target
&str