@@ -357,7 +357,7 @@ impl Body {
357357 /// res.set_body(Body::from_file("/path/to/file").await?);
358358 /// # Ok(()) }) }
359359 /// ```
360- #[ cfg( all( feature = "async_std " , not( target_os = "unknown" ) ) ) ]
360+ #[ cfg( all( feature = "fs " , not( target_os = "unknown" ) ) ) ]
361361 pub async fn from_file < P > ( path : P ) -> io:: Result < Self >
362362 where
363363 P : AsRef < std:: path:: Path > ,
@@ -477,7 +477,7 @@ impl AsyncBufRead for Body {
477477
478478/// Look at first few bytes of a file to determine the mime type.
479479/// This is used for various binary formats such as images and videos.
480- #[ cfg( all( feature = "async_std " , not( target_os = "unknown" ) ) ) ]
480+ #[ cfg( all( feature = "fs " , not( target_os = "unknown" ) ) ) ]
481481async fn peek_mime ( file : & mut async_std:: fs:: File ) -> io:: Result < Option < Mime > > {
482482 // We need to read the first 300 bytes to correctly infer formats such as tar.
483483 let mut buf = [ 0_u8 ; 300 ] ;
@@ -491,7 +491,7 @@ async fn peek_mime(file: &mut async_std::fs::File) -> io::Result<Option<Mime>> {
491491
492492/// Look at the extension of a file to determine the mime type.
493493/// This is useful for plain-text formats such as HTML and CSS.
494- #[ cfg( all( feature = "async_std " , not( target_os = "unknown" ) ) ) ]
494+ #[ cfg( all( feature = "fs " , not( target_os = "unknown" ) ) ) ]
495495fn guess_ext ( path : & std:: path:: Path ) -> Option < Mime > {
496496 let ext = path. extension ( ) . map ( |p| p. to_str ( ) ) . flatten ( ) ;
497497 ext. and_then ( Mime :: from_extension)
0 commit comments