Skip to content

Commit

Permalink
wip: revert to handle state change
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Adossi <[email protected]>
  • Loading branch information
vados-cosmonic committed Jan 31, 2025
1 parent c21630d commit ea054b0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crates/guest-rust/rt/src/async_support/stream_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ pub struct StreamWriter<T: 'static> {
handle: u32,
future: Option<Pin<Box<dyn Future<Output = ()> + 'static>>>,
vtable: &'static StreamVtable<T>,
error: Option<ErrorContext>,
}

impl<T> StreamWriter<T> {
Expand All @@ -82,7 +81,6 @@ impl<T> StreamWriter<T> {
handle,
future: None,
vtable,
error: None,
}
}

Expand All @@ -102,8 +100,8 @@ impl<T> StreamWriter<T> {
super::with_entry(self.handle, move |entry| match entry {
Entry::Vacant(_) => unreachable!(),
Entry::Occupied(mut entry) => match entry.get_mut() {
// Regardless of current state, put the writer into a closed with error state
_ => {
// Note: the impending drop after this function runs should trigger
entry.insert(Handle::WriteClosedErr(err.handle()));
}
},
Expand Down

0 comments on commit ea054b0

Please sign in to comment.