You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When this code runs, every entry (including subdirectories) of the included Dir are returned as files.
let entries = dir.find("**").expect("Failed to find entries (pattern error )");
for e in entries {
if e.path().is_dir() {
println!("{:?} is a directory!", e.path().display());
} else {
println!("{:?} is a file!", e.path().display());
}
}
The text was updated successfully, but these errors were encountered:
I'm not sure if this is working as expected. The workaround is to use dir.get_dir:
let entries = dir.find("**").expect("Failed to find entries (pattern error )");
for e in entries {
if dir.get_dir(e.path()).is_some() {
println!("{:?} is a directory!", e.path().display());
} else {
println!("{:?} is a file!", e.path().display());
}
}
When this code runs, every entry (including subdirectories) of the included Dir are returned as files.
The text was updated successfully, but these errors were encountered: