/// Assuming that path is a directory, this function returns a list of
/// all entries inside that directory.
Assuming that path is a directory, this function returns a list of
all entries inside that directory.
Assuming that path is a directory this function returns a list of all entries inside that directory .
fn list_directory_children<P: AsRef<Path>>(&mut self, path: P) -> Vec<PathBuf> {
		let mut children = Vec::new();
		let entries = match path.as_ref().read_dir() {
			Ok(entries) => entries,
			Err(err) => {
				warn!("Unable to read directory '{}'.  The following error was received: {}", path.as_ref().display(), err);
				return Vec::new();
			}
		};
		for entry in entries {
			let entry = match entry {
				Ok(x) => x,
				Err(err) => {
					warn!("Unable to read contents of directory '{}'.  The following error was received: {}", path.as_ref().display(), err);
					return Vec::new();
				}
			};
			children.push(entry.path());
		}
		children
	}
fn list_directory_children < P : AsRef < Path > > ( & mut self , path : P ) -> Vec < PathBuf > { let mut children = Vec :: new ( ) ; let entries = match path . as_ref ( ) . read_dir ( ) { Ok ( entries ) => entries , Err ( err ) => { warn ! ( " " path as_ref ( ) display ( ) err ) ; return Vec :: new ( ) ; } } ; for entry in entries { let entry = match entry { Ok ( x ) => x , Err ( err ) => { warn ! ( " " path as_ref ( ) display ( ) err ) ; return Vec :: new ( ) ; } } ; children . push ( entry . path ( ) ) ; } children }
Assuming that path is a directory, this function returns a list of
all entries inside that directory.
Assuming that path is a directory this function returns a list of all entries inside that directory .
&mut self
path
P