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 authored and Martin Algesten committed 2020-05-20 20:55:19 +02:00
1 parent 71a9df17e3
commit b61991d87e
2 files changed
+3

No files matched your search

+2
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
+1
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?