Skip to content

Commit

Permalink
thanks clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Dec 15, 2022
1 parent 7d5b8b8 commit 7e300c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/core/dir_entry_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ impl<C: ClientState> DirEntryIter<C> {
read_dir_iter,
read_dir_results_stack: vec![root_entry_results.into_iter()],
}
.into()
}

fn push_next_read_dir_results(
Expand Down Expand Up @@ -87,7 +86,7 @@ impl<C: ClientState> Iterator for DirEntryIter<C> {
// 2.2 If dir_entry has a read_children_path means we need to read a new
// directory and push those results onto read_dir_results_stack
if dir_entry.read_children_path.is_some() {
let iter = match self.read_dir_iter.as_mut().ok_or_else(|| Error::busy()) {
let iter = match self.read_dir_iter.as_mut().ok_or_else(Error::busy) {
Ok(iter) => iter,
Err(err) => return Some(Err(err)),
};
Expand Down
6 changes: 2 additions & 4 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,6 @@ fn sort() {
assert_eq!(expected, r.paths());
}

use fs_extra;

fn test_dir() -> (PathBuf, tempfile::TempDir) {
let template = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/assets/test_dir");
let temp_dir = tempfile::tempdir().unwrap();
Expand All @@ -805,7 +803,7 @@ fn local_paths(walk_dir: WalkDir) -> Vec<String> {
if let Some(err) = each_entry.read_children_error.as_ref() {
panic!("should not encounter any child errors :{:?}", err);
}
let path = each_entry.path().to_path_buf();
let path = each_entry.path();
let path = path.strip_prefix(&root).unwrap().to_path_buf();
let mut path_string = path.to_str().unwrap().to_string();
path_string.push_str(&format!(" ({})", each_entry.depth));
Expand Down Expand Up @@ -993,7 +991,7 @@ fn error_when_path_removed_durring_iteration() {
let _ = iter.next().unwrap().is_ok(); // " (0)",

// Remove group 2 dir from disk
fs_extra::remove_items(&vec![test_dir.join("group 2")]).unwrap();
fs_extra::remove_items(&[test_dir.join("group 2")]).unwrap();

let _ = iter.next().unwrap().is_ok(); // "a.txt (1)",
let _ = iter.next().unwrap().is_ok(); // "b.txt (1)",
Expand Down

0 comments on commit 7e300c6

Please sign in to comment.