@@ -283,7 +283,7 @@ impl Body {
283283 pub async fn into_json < T : DeserializeOwned > ( mut self ) -> crate :: Result < T > {
284284 let mut buf = Vec :: with_capacity ( 1024 ) ;
285285 self . read_to_end ( & mut buf) . await ?;
286- Ok ( serde_json:: from_slice ( & buf) . status ( StatusCode :: UnprocessableEntity ) ? )
286+ serde_json:: from_slice ( & buf) . status ( StatusCode :: UnprocessableEntity )
287287 }
288288
289289 /// Creates a `Body` from a type, serializing it using form encoding.
@@ -356,7 +356,7 @@ impl Body {
356356 #[ cfg( feature = "serde" ) ]
357357 pub async fn into_form < T : DeserializeOwned > ( self ) -> crate :: Result < T > {
358358 let s = self . into_string ( ) . await ?;
359- Ok ( serde_urlencoded:: from_str ( & s) . status ( StatusCode :: UnprocessableEntity ) ? )
359+ serde_urlencoded:: from_str ( & s) . status ( StatusCode :: UnprocessableEntity )
360360 }
361361
362362 /// Create a `Body` from a file named by a path.
@@ -630,7 +630,7 @@ async fn peek_mime(file: &mut async_std::fs::File) -> io::Result<Option<Mime>> {
630630/// This is useful for plain-text formats such as HTML and CSS.
631631#[ cfg( all( feature = "fs" , not( target_os = "unknown" ) ) ) ]
632632fn guess_ext ( path : & std:: path:: Path ) -> Option < Mime > {
633- let ext = path. extension ( ) . map ( |p| p. to_str ( ) ) . flatten ( ) ;
633+ let ext = path. extension ( ) . and_then ( |p| p. to_str ( ) ) ;
634634 ext. and_then ( Mime :: from_extension)
635635}
636636
0 commit comments