Skip to content

Commit

Permalink
Return err if not exist in memory fs for canonical
Browse files Browse the repository at this point in the history
  • Loading branch information
azdavis committed Feb 27, 2024
1 parent c42a13d commit 861ec83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/paths/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ impl FileSystem for MemoryFileSystem {
}

fn canonical(&self, path: &Path) -> std::io::Result<CanonicalPathBuf> {
Ok(CanonicalPathBuf(path.to_owned()))
if self.inner.contains_key(path) {
Ok(CanonicalPathBuf(path.to_owned()))
} else {
Err(std::io::Error::from(std::io::ErrorKind::NotFound))
}
}
}

Expand Down

0 comments on commit 861ec83

Please sign in to comment.