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:
nickelc
2021-02-18 01:48:08 +01:00
committed by GitHub
parent 727903f69a
commit c27cd06a11
10 changed files with 38 additions and 0 deletions

View File

@@ -77,6 +77,7 @@ impl Response {
/// Try to deserialize the response body as JSON.
#[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?;