diff --git a/crates/wasi-common/virtfs/src/lib.rs b/crates/wasi-common/virtfs/src/lib.rs index 9f000ca57a..8fcd868dec 100644 --- a/crates/wasi-common/virtfs/src/lib.rs +++ b/crates/wasi-common/virtfs/src/lib.rs @@ -2,7 +2,7 @@ use cap_std::time::{Duration, SystemTime}; use std::any::Any; use std::cell::{Cell, Ref, RefCell, RefMut}; -use std::collections::HashMap; +use std::collections::{hash_map::Entry, HashMap}; use std::convert::TryInto; use std::io::{Cursor, IoSlice, IoSliceMut, Read, Seek, SeekFrom, Write}; use std::ops::Deref; @@ -16,12 +16,52 @@ use wasi_common::{ }; pub struct Filesystem { - root: Rc>, + // Always .get() out a Some - this is an RefCell