Skip to content

Commit

Permalink
string mistake fix
Browse files Browse the repository at this point in the history
  • Loading branch information
conaticus committed Jul 2, 2023
1 parent 927f591 commit 4c853e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src-tauri/src/filesystem/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl FsEventHandler {
.to_string();

let file_path = path.to_string_lossy().to_string();
current_volume.entry(filename).or_insert(vec![CachedPath {
current_volume.entry(filename).or_insert_with(|| vec![CachedPath {
file_path,
file_type,
}]);
Expand Down Expand Up @@ -100,7 +100,7 @@ impl FsEventHandler {
let file_type = if new_path.is_dir() { DIRECTORY } else { FILE };

let path_string = new_path.to_string_lossy().to_string();
current_volume.entry(filename).or_insert(vec![CachedPath {
current_volume.entry(filename).or_insert_with(|| vec![CachedPath {
file_path: path_string,
file_type: String::from(file_type),
}]);
Expand Down
6 changes: 3 additions & 3 deletions src-tauri/src/filesystem/volume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Volume {
WalkDir::new(self.mountpoint.clone())
.into_iter()
.par_bridge()
.filter_map(|entry| entry.ok())
.filter_map(Result::ok)
.for_each(|entry| {
let file_name = entry.file_name().to_string_lossy().to_string();
let file_path = entry.path().to_string_lossy().to_string();
Expand Down Expand Up @@ -95,7 +95,7 @@ impl Volume {

let mut watcher = notify::recommended_watcher(move |res| match res {
Ok(event) => fs_event_manager.handle_event(event),
Err(e) => panic!("Failed to handle event: {:?}", e),
Err(e) => panic!("Failed to handle event: {}", e),
})
.unwrap();

Expand All @@ -106,7 +106,7 @@ impl Volume {

block_in_place(|| loop {
thread::park();
})
});
});
}
}
Expand Down

0 comments on commit 4c853e2

Please sign in to comment.