Skip to content

Commit 9d976dc

Browse files
committed
Clean up the diff
1 parent 60abe0e commit 9d976dc

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

crates/wasi-http/src/types.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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 {

crates/wasi-http/src/types_impl.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,15 @@ use wasmtime_wasi::preview2::{
2020
impl<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.
2624
fn 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

0 commit comments

Comments
 (0)