Pick files directly from the Fs in simulate_host
Previously, the list of all existing files was maintained separately, but it was not updated when a guest created a file.
This commit is contained in:
parent
3d6db9083d
commit
2aec4ff234
2 changed files with 22 additions and 22 deletions
|
@ -376,6 +376,16 @@ impl FakeFs {
|
|||
.boxed()
|
||||
}
|
||||
|
||||
pub async fn files(&self) -> Vec<PathBuf> {
|
||||
self.state
|
||||
.lock()
|
||||
.await
|
||||
.entries
|
||||
.iter()
|
||||
.filter_map(|(path, entry)| entry.content.as_ref().map(|_| path.clone()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
async fn simulate_random_delay(&self) {
|
||||
self.executor
|
||||
.upgrade()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue