From b61991d87e4d3a30739f7125e8eaed1349067eb0 Mon Sep 17 00:00:00 2001 From: Rob Young Date: Thu, 14 May 2020 20:04:44 +0100 Subject: [PATCH] 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 --- src/lib.rs | 2 ++ src/unit.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 8db0fd7..b0c457e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 diff --git a/src/unit.rs b/src/unit.rs index 06c384c..4efa65a 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -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?