Skip to content

Commit 0d37d76

Browse files
Fix unwrap.
1 parent 3b14335 commit 0d37d76

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ext/hyper_ruby/src/response.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,14 @@ impl Response {
6161
let body = self.response.body();
6262
match body.clone().frame().now_or_never() {
6363
Some(frame) => {
64-
let frame = frame.unwrap();
65-
let frame = frame.unwrap();
66-
let data_chunk = frame.into_data().unwrap();
67-
RString::from_slice(data_chunk.iter().as_slice())
64+
match frame {
65+
Some(frame) => {
66+
let frame = frame.unwrap();
67+
let data_chunk = frame.into_data().unwrap();
68+
RString::from_slice(data_chunk.iter().as_slice())
69+
},
70+
None => RString::buf_new(0),
71+
}
6872
}
6973
None => RString::buf_new(0),
7074
}

0 commit comments

Comments
 (0)