Fix a couple of feature flag uses

Wrap a json doc-test in cfg block to stop in failing when tests are
run with --no-default-features
This commit is contained in:
Rob Young
2020-05-14 20:04:44 +01:00
committed by Martin Algesten
parent 71a9df17e3
commit b61991d87e
2 changed files with 3 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
//!
//! ```
//! // requires feature: `ureq = { version = "*", features = ["json"] }`
//! # #[cfg(feature = "json")] {
//! use ureq::json;
//!
//! // sync post request of some json.
@@ -22,6 +23,7 @@
//! if resp.ok() {
//! // ....
//! }
//! # }
//! ```
//!
//! # Plain requests

View File

@@ -16,6 +16,7 @@ use crate::{Error, Header, Request, Response};
#[cfg(feature = "tls")]
use crate::request::TLSClientConfig;
#[cfg(feature = "cookie")]
use crate::pool::DEFAULT_HOST;
/// It's a "unit of work". Maybe a bad name for it?