mirror of
https://github.com/nushell/nushell
synced 2024-12-28 22:13:10 +00:00
Remove an unwrap
This commit is contained in:
parent
399b411a9c
commit
03c29b9a6f
1 changed files with 5 additions and 1 deletions
|
@ -135,7 +135,11 @@ impl Shell for FilesystemShell {
|
||||||
// Enumerate the entries from the glob and add each
|
// Enumerate the entries from the glob and add each
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
if let Ok(entry) = entry {
|
if let Ok(entry) = entry {
|
||||||
let filename = entry.strip_prefix(&cwd).unwrap();
|
let filename = if let Ok(fname) = entry.strip_prefix(&cwd) {
|
||||||
|
fname
|
||||||
|
} else {
|
||||||
|
Path::new(&entry)
|
||||||
|
};
|
||||||
let metadata = std::fs::metadata(&entry)?;
|
let metadata = std::fs::metadata(&entry)?;
|
||||||
let value = dir_entry_dict(
|
let value = dir_entry_dict(
|
||||||
filename,
|
filename,
|
||||||
|
|
Loading…
Reference in a new issue