Skip to content

Commit 0f6dcc5

Browse files
ranfdevbilelmoussaoui
authored andcommitted
Fix panic in gio InputStream
1 parent 11a9402 commit 0f6dcc5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gio/src/input_stream.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,9 @@ impl<T: IsA<InputStream>> InputStreamAsyncBufRead<T> {
450450
}
451451
}
452452
Poll::Ready(Err((_, err))) => {
453-
let kind = err.kind::<crate::IOErrorEnum>().unwrap();
453+
let kind = err
454+
.kind::<crate::IOErrorEnum>()
455+
.unwrap_or(crate::IOErrorEnum::Failed);
454456
self.state = State::Failed(kind);
455457
Poll::Ready(Err(io::Error::new(io::ErrorKind::from(kind), err)))
456458
}

0 commit comments

Comments
 (0)