Skip to content

Commit

Permalink
wip: add AsRef<Path> to visit_files
Browse files Browse the repository at this point in the history
  • Loading branch information
berkus committed Jan 29, 2024
1 parent 8097898 commit 892bbf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/support/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {

// one possible implementation of walking a directory only visiting files
#[throws]
pub fn visit_files(dir: &Path, cb: &mut dyn for<'r> FnMut(&'r DirEntry) -> Result<()>) {
pub fn visit_files<P: AsRef<Path>>(dir: P, cb: &mut dyn for<'r> FnMut(&'r DirEntry) -> Result<()>) {
if dir.is_dir() {
for entry in fs::read_dir(dir)? {
let entry = entry?;
Expand Down

0 comments on commit 892bbf4

Please sign in to comment.