File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use http::StatusCode;
22use wasip2:: http:: types:: IncomingResponse ;
33
44use crate :: http:: body:: { Body , BodyHint } ;
5- use crate :: http:: error:: { Context , Error } ;
5+ use crate :: http:: error:: Error ;
66use crate :: http:: fields:: { HeaderMap , header_map_from_wasi} ;
77
88pub use http:: response:: { Builder , Response } ;
@@ -22,10 +22,8 @@ pub(crate) fn try_from_incoming(incoming: IncomingResponse) -> Result<Response<B
2222 let body = Body :: from_incoming ( incoming_body, hint) ;
2323
2424 let mut builder = Response :: builder ( ) . status ( status) ;
25-
26- if let Some ( headers_mut) = builder. headers_mut ( ) {
27- * headers_mut = headers;
28- }
29-
30- builder. body ( body) . context ( "building response" )
25+ * builder. headers_mut ( ) . expect ( "builder has not errored" ) = headers;
26+ Ok ( builder
27+ . body ( body)
28+ . expect ( "response builder should not error" ) )
3129}
You can’t perform that action at this time.
0 commit comments