Use doc_cfg to show feature requirements (#1134)
				
					
				
			* Use `doc_cfg` to show feature requirements * Apply suggestions from code review
This commit is contained in:
		| @@ -103,6 +103,7 @@ impl Response { | ||||
|     /// | ||||
|     /// This requires the optional `cookies` feature to be enabled. | ||||
|     #[cfg(feature = "cookies")] | ||||
|     #[cfg_attr(docsrs, doc(cfg(feature = "cookies")))] | ||||
|     pub fn cookies<'a>(&'a self) -> impl Iterator<Item = cookie::Cookie<'a>> + 'a { | ||||
|         cookie::extract_response_cookies(&self.headers).filter_map(Result::ok) | ||||
|     } | ||||
| @@ -236,6 +237,7 @@ impl Response { | ||||
|     /// | ||||
|     /// [`serde_json::from_reader`]: https://docs.serde.rs/serde_json/fn.from_reader.html | ||||
|     #[cfg(feature = "json")] | ||||
|     #[cfg_attr(docsrs, doc(cfg(feature = "json")))] | ||||
|     pub async fn json<T: DeserializeOwned>(self) -> crate::Result<T> { | ||||
|         let full = self.bytes().await?; | ||||
|  | ||||
| @@ -308,6 +310,7 @@ impl Response { | ||||
|     /// | ||||
|     /// This requires the optional `stream` feature to be enabled. | ||||
|     #[cfg(feature = "stream")] | ||||
|     #[cfg_attr(docsrs, doc(cfg(feature = "stream")))] | ||||
|     pub fn bytes_stream(self) -> impl futures_core::Stream<Item = crate::Result<Bytes>> { | ||||
|         self.body | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user