@@ -63,26 +63,17 @@ pub fn try_from_incoming_request(
63
63
64
64
let method = from_wasi_method ( incoming. method ( ) )
65
65
. map_err ( |_| WasiHttpErrorCode :: HttpRequestMethodInvalid ) ?;
66
- let scheme = match incoming. scheme ( ) {
67
- Some ( scheme) => Some (
68
- from_wasi_scheme ( scheme) . expect ( "TODO: what shall we do with an invalid uri here?" ) ,
69
- ) ,
70
- None => None ,
71
- } ;
72
- let authority = match incoming. authority ( ) {
73
- Some ( authority) => Some (
74
- Authority :: from_maybe_shared ( authority)
75
- . expect ( "TODO: what shall we do with an invalid uri authority here?" ) ,
76
- ) ,
77
- None => None ,
78
- } ;
79
- let path_and_query = match incoming. path_with_query ( ) {
80
- Some ( path_and_query) => Some (
81
- PathAndQuery :: from_maybe_shared ( path_and_query)
82
- . expect ( "TODO: what shall we do with an invalid uri path-and-query here?" ) ,
83
- ) ,
84
- None => None ,
85
- } ;
66
+ let scheme = incoming. scheme ( ) . map ( |scheme| {
67
+ from_wasi_scheme ( scheme) . expect ( "TODO: what shall we do with an invalid uri here?" )
68
+ } ) ;
69
+ let authority = incoming. authority ( ) . map ( |authority| {
70
+ Authority :: from_maybe_shared ( authority)
71
+ . expect ( "TODO: what shall we do with an invalid uri authority here?" )
72
+ } ) ;
73
+ let path_and_query = incoming. path_with_query ( ) . map ( |path_and_query| {
74
+ PathAndQuery :: from_maybe_shared ( path_and_query)
75
+ . expect ( "TODO: what shall we do with an invalid uri path-and-query here?" )
76
+ } ) ;
86
77
87
78
// TODO: What's the right error code to use for invalid headers?
88
79
let kind = BodyKind :: from_headers ( & headers)
0 commit comments