File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -333,9 +333,6 @@ pub enum HostFields {
333333 // always be registered as a child of the entry with the `parent` id. This ensures that the
334334 // entry will always exist while this `HostFields::Ref` entry exists in the table, thus we
335335 // don't need to account for failure when fetching the fields ref from the parent.
336- //
337- // NOTE: references are always considered immutable -- the only way to modify fields is to
338- // create an owned version first.
339336 get_fields : for <' a > fn ( elem : & ' a mut ( dyn Any + ' static ) ) -> & ' a mut FieldMap ,
340337 } ,
341338 Owned {
Original file line number Diff line number Diff line change @@ -20,18 +20,15 @@ use wasmtime_wasi::preview2::{
2020impl < T : WasiHttpView > crate :: bindings:: http:: types:: Host for T { }
2121
2222/// Take ownership of the underlying [`FieldMap`] associated with this fields resource. If the
23- /// fields resource references another fields, the returned [`FieldMap`] will be cloned. We throw
24- /// away the `immutable` status of the original fields, as the new context will determine how the
25- /// [`FieldMap`] is used.
23+ /// fields resource references another fields, the returned [`FieldMap`] will be cloned.
2624fn move_fields ( table : & mut Table , id : Resource < HostFields > ) -> wasmtime:: Result < FieldMap > {
2725 match table. delete ( id) ? {
2826 HostFields :: Ref { parent, get_fields } => {
2927 let entry = table. get_any_mut ( parent) ?;
30- let fields = get_fields ( entry) ;
31- Ok ( fields. clone ( ) )
28+ Ok ( get_fields ( entry) . clone ( ) )
3229 }
3330
34- HostFields :: Owned { fields, .. } => Ok ( fields) ,
31+ HostFields :: Owned { fields } => Ok ( fields) ,
3532 }
3633}
3734
You can’t perform that action at this time.
0 commit comments