docs(body) fix doctest failing due to missing features

The doctest uses `hyper::Client`, but that is not available unless these features are enabled.
This commit adds an attribute to check for those and allows `cargo test` with no arguments to pass again.

fixes #2687.
This commit is contained in:
muvlon
2021-11-06 19:42:25 +01:00
committed by Sean McArthur
parent 80627141ed
commit 3221f573d2

View File

@@ -17,6 +17,7 @@ use super::HttpBody;
/// # Example /// # Example
/// ///
/// ``` /// ```
/// # #[cfg(all(feature = "client", any(feature = "http1", feature = "http2")))]
/// # async fn doc() -> hyper::Result<()> { /// # async fn doc() -> hyper::Result<()> {
/// use hyper::{body::HttpBody}; /// use hyper::{body::HttpBody};
/// ///