// Walk the file tree from self.base_path, gathering metadata about all the files
Walk the file tree from self.base_path, gathering metadata about all the files
Walk the file tree from self . base_path gathering metadata about all the files
fn walk(&mut self) -> Result<()> {
		self.files = Vec::new();
		self.total_size = 0;
		let base_path = self.base_path.clone();
		let base_path_metadata = self.base_path.metadata()?;
		let current_filesystem = if self.config.one_file_system { Some(base_path_metadata.dev()) } else { None };
		let mut unscanned_paths: Vec<PathBuf> = Vec::new();
		unscanned_paths.extend(self.list_directory_children(&base_path));
		while let Some(path) = unscanned_paths.pop() {
			let file = match self.read_file_metadata(path, current_filesystem) {
				Some(file) => file,
				None => continue,
			};
			if file.file.symlink.is_none() && file.file.is_dir {
				unscanned_paths.extend(self.list_directory_children(base_path.join(&file.file.path)));
			}
			self.total_size += file.file.size;
			self.files.push(file);
		}
		Ok(())
	}
fn walk ( & mut self ) -> Result < ( ) > { self . files = Vec :: new ( ) ; self . total_size = 0 ; let base_path = self . base_path . clone ( ) ; let base_path_metadata = self . base_path . metadata ( ) ? ; let current_filesystem = if self . config . one_file_system { Some ( base_path_metadata . dev ( ) ) } else { None } ; let mut unscanned_paths : Vec < PathBuf > = Vec :: new ( ) ; unscanned_paths . extend ( self . list_directory_children ( & base_path ) ) ; while let Some ( path ) = unscanned_paths . pop ( ) { let file = match self . read_file_metadata ( path , current_filesystem ) { Some ( file ) => file , None => continue , } ; if file . file . symlink . is_none ( ) && file . file . is_dir { unscanned_paths . extend ( self . list_directory_children ( base_path . join ( & file . file . path ) ) ) ; } self . total_size += file . file . size ; self . files . push ( file ) ; } Ok ( ( ) ) }
Walk the file tree from self.base_path, gathering metadata about all the files
Walk the file tree from self . base_path gathering metadata about all the files
&mut self