Doc: stream feature is needed for wrap_stream and From<File> for Body (#1456)

At least `wrap_stream` it is written in plain text, but adding the visual flag should be better and coherent with `byte_stream` documentation, but nothing is shown for `From<File>` for `Body`.

Co-authored-by: kraktus <kraktus@users.noreply.github.com>
This commit is contained in:
kraktus
2022-02-03 00:09:25 +01:00
committed by GitHub
parent d92d2aa3ce
commit 9339c54323

View File

@@ -79,6 +79,7 @@ impl Body {
/// ///
/// This requires the `stream` feature to be enabled. /// This requires the `stream` feature to be enabled.
#[cfg(feature = "stream")] #[cfg(feature = "stream")]
#[cfg_attr(docsrs, doc(cfg(feature = "stream")))]
pub fn wrap_stream<S>(stream: S) -> Body pub fn wrap_stream<S>(stream: S) -> Body
where where
S: futures_core::stream::TryStream + Send + Sync + 'static, S: futures_core::stream::TryStream + Send + Sync + 'static,
@@ -213,6 +214,7 @@ impl From<&'static str> for Body {
} }
#[cfg(feature = "stream")] #[cfg(feature = "stream")]
#[cfg_attr(docsrs, doc(cfg(feature = "stream")))]
impl From<File> for Body { impl From<File> for Body {
#[inline] #[inline]
fn from(file: File) -> Body { fn from(file: File) -> Body {