mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Speed up mdtests (#13832)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
fa7626160b
commit
9e3cf14dde
5 changed files with 37 additions and 16 deletions
|
@ -351,6 +351,17 @@ impl MemoryFileSystem {
|
|||
|
||||
Ok(ReadDirectory::new(collected))
|
||||
}
|
||||
|
||||
/// Removes all files and directories except the current working directory.
|
||||
pub fn remove_all(&self) {
|
||||
self.inner.virtual_files.write().unwrap().clear();
|
||||
|
||||
self.inner
|
||||
.by_path
|
||||
.write()
|
||||
.unwrap()
|
||||
.retain(|key, _| key == self.inner.cwd.as_utf8_path());
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for MemoryFileSystem {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue