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 ba75675 commit b821579
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/impls/overlay.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! An overlay file system combining two filesystems, an upper layer with read/write access and a lower layer with only read access

use crate::error::VfsResultExt;
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 @@ -153,7 +153,11 @@ impl FileSystem for OverlayFS {
}

fn exists(&self, path: &str) -> VfsResult<bool> {
if self.whiteout_path(path).with_context(|| "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 b821579

Please sign in to comment.