diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-09-26 13:59:04 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-09-26 13:59:04 -0400 |
commit | 98aaa57fb33e69fb6daf12b828ac6384caece44b (patch) | |
tree | 0cc70f9e0c81e397d600c1deba422617b03f74a3 /src/fs | |
parent | a918005d837fcd3a882dba6e4e713a730a6190ce (diff) |
code cleanup
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/dirlist.rs | 2 | ||||
-rw-r--r-- | src/fs/entry.rs | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/fs/dirlist.rs b/src/fs/dirlist.rs index 8500b07..d74a799 100644 --- a/src/fs/dirlist.rs +++ b/src/fs/dirlist.rs @@ -32,7 +32,7 @@ impl JoshutoDirList { pub fn from_path(path: path::PathBuf, options: &DisplayOption) -> std::io::Result<Self> { let filter_func = options.filter_func(); - let mut contents = read_directory(path.as_path(), filter_func, &options)?; + let mut contents = read_directory(path.as_path(), filter_func, options)?; let sort_options = options.sort_options_ref(); contents.sort_by(|f1, f2| sort_options.compare(f1, f2)); diff --git a/src/fs/entry.rs b/src/fs/entry.rs index 5875a78..a36648b 100644 --- a/src/fs/entry.rs +++ b/src/fs/entry.rs @@ -138,6 +138,5 @@ fn create_icon_label(name: &str, metadata: &JoshutoMetadata) -> String { } fn get_directory_size(path: &path::Path) -> io::Result<usize> { - let directory_size = fs::read_dir(path).map(|s| s.count()); - directory_size + fs::read_dir(path).map(|s| s.count()) } |