Skip to content

Commit

Permalink
fix(overlay): remove potential panic (fixes #23)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-woelker committed Feb 7, 2022
1 parent 8624a00 commit ba75675
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/impls/overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::{FileSystem, SeekAndRead, VfsError, VfsMetadata, VfsPath, VfsResult};
use std::collections::HashSet;
use std::io::Write;
use crate::error::VfsResultExt;

/// An overlay file system combining several filesystems into one, an upper layer with read/write access and lower layers with only read access
///
Expand Down Expand Up @@ -152,7 +153,7 @@ impl FileSystem for OverlayFS {
}

fn exists(&self, path: &str) -> VfsResult<bool> {
if self.whiteout_path(path).expect("whiteout_path").exists()? {
if self.whiteout_path(path).with_context(|| "whiteout_path")?.exists()? {
return Ok(false);
}
self.read_path(path)
Expand Down

0 comments on commit ba75675

Please sign in to comment.