@@ -507,7 +507,7 @@ impl AsyncRead for Body {
507507 cx : & mut Context < ' _ > ,
508508 buf : & mut [ u8 ] ,
509509 ) -> Poll < io:: Result < usize > > {
510- let mut buf = match self . length {
510+ let buf = match self . length {
511511 None => buf,
512512 Some ( length) if length == self . bytes_read => return Poll :: Ready ( Ok ( 0 ) ) ,
513513 Some ( length) => {
@@ -516,7 +516,7 @@ impl AsyncRead for Body {
516516 }
517517 } ;
518518
519- let bytes = ready ! ( Pin :: new( & mut self . reader) . poll_read( cx, & mut buf) ) ?;
519+ let bytes = ready ! ( Pin :: new( & mut self . reader) . poll_read( cx, buf) ) ?;
520520 self . bytes_read += bytes;
521521 Poll :: Ready ( Ok ( bytes) )
522522 }
@@ -551,7 +551,7 @@ async fn peek_mime(file: &mut async_std::fs::File) -> io::Result<Option<Mime>> {
551551/// This is useful for plain-text formats such as HTML and CSS.
552552#[ cfg( all( feature = "fs" , not( target_os = "unknown" ) ) ) ]
553553fn guess_ext ( path : & std:: path:: Path ) -> Option < Mime > {
554- let ext = path. extension ( ) . map ( |p| p. to_str ( ) ) . flatten ( ) ;
554+ let ext = path. extension ( ) . and_then ( |p| p. to_str ( ) ) ;
555555 ext. and_then ( Mime :: from_extension)
556556}
557557
@@ -565,7 +565,7 @@ mod test {
565565 async fn json_status ( ) {
566566 #[ derive( Debug , Deserialize ) ]
567567 struct Foo {
568- inner : String ,
568+ _inner : String ,
569569 }
570570 let body = Body :: empty ( ) ;
571571 let res = body. into_json :: < Foo > ( ) . await ;
@@ -576,7 +576,7 @@ mod test {
576576 async fn form_status ( ) {
577577 #[ derive( Debug , Deserialize ) ]
578578 struct Foo {
579- inner : String ,
579+ _inner : String ,
580580 }
581581 let body = Body :: empty ( ) ;
582582 let res = body. into_form :: < Foo > ( ) . await ;
0 commit comments