File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,10 @@ impl AsyncRead for AsyncInputStream {
40
40
// Ideally, the ABI would be able to read directly into buf. However, with the default
41
41
// generated bindings, it returns a newly allocated vec, which we need to copy into buf.
42
42
let read = match self . stream . read ( buf. len ( ) as u64 ) {
43
- // 0 bytets from WASI's `read` just means we got zero bytes.
44
- Ok ( r ) if r . is_empty ( ) => {
45
- return Err ( std :: io :: Error :: from ( std :: io :: ErrorKind :: Interrupted ) )
46
- }
43
+ // We don't need to special-case 0 here: a value of 0 bytes from
44
+ // WASI's `read` doesn't mean end-of-stream as it does in Rust,
45
+ // however since we called `self.ready()`, we'll always get at
46
+ // least one byte.
47
47
Ok ( r) => r,
48
48
// 0 bytes from Rust's `read` means end-of-stream.
49
49
Err ( StreamError :: Closed ) => return Ok ( 0 ) ,
You can’t perform that action at this time.
0 commit comments