Skip to content

Commit

Permalink
Rename files::from_path to files::walk_dir (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleury authored Sep 7, 2024
1 parent f68f85e commit bd824bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::path::PathBuf;

use crate::bytes;

pub fn from_path(path: &str) -> io::Result<FileIter> {
pub fn walk_dir(path: &str) -> io::Result<FileIter> {
let dir = std::fs::read_dir(path)?;
Ok(FileIter { stack: vec![dir] })
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use files::File;
/// ```
pub fn find_top_n_largest_files(path: &str, n: usize) -> io::Result<Vec<File>> {
let mut results = BTreeMap::new();
for file in files::from_path(path)? {
for file in files::walk_dir(path)? {
results.insert(file.clone(), file);
}
Ok(results.into_values().rev().take(n).collect())
Expand Down

0 comments on commit bd824bb

Please sign in to comment.