Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sberm committed Mar 20, 2024
1 parent 027df28 commit 4ad4435
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@ impl Browser {
return ret
}

for entry in read_dir(&dir_under_cursor).unwrap() {
let entry = entry.unwrap();
let s = entry.file_name().into_string();
match s {
Ok(v) => {ret.push(v);}
Err(e) => {
let str = entry.file_name().to_string_lossy().into_owned();
ret.push(str);
if let Ok(entries) = read_dir(dir_under_cursor) {
for entry in entries {
let entry = entry.unwrap();
let s = entry.file_name().into_string();
match s {
Ok(v) => {ret.push(v);}
Err(e) => {
let str = entry.file_name().to_string_lossy().into_owned();
ret.push(str);
}
}
}
}
Expand Down

0 comments on commit 4ad4435

Please sign in to comment.