Skip to content

Commit 6681a69

Browse files
committed
Don't io::Error::map_err to ErrorKind::Other
If we already have an `io::Error`, we shouldn't remap to `Other`, as it would have us lose type information.
1 parent 9d32931 commit 6681a69

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lightning-persister/src/fs_store.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,14 +373,7 @@ fn dir_entry_is_key(dir_entry: &fs::DirEntry) -> Result<bool, lightning::io::Err
373373
}
374374
}
375375

376-
let metadata = dir_entry.metadata().map_err(|e| {
377-
let msg = format!(
378-
"Failed to list keys at path {}: {}",
379-
PrintableString(p.to_str().unwrap_or_default()),
380-
e
381-
);
382-
lightning::io::Error::new(lightning::io::ErrorKind::Other, msg)
383-
})?;
376+
let metadata = dir_entry.metadata()?;
384377

385378
// We allow the presence of directories in the empty primary namespace and just skip them.
386379
if metadata.is_dir() {

0 commit comments

Comments
 (0)