From 3f97525a64a7e529eebede59cc3c02a1c6d042ac Mon Sep 17 00:00:00 2001 From: Patrick Fernie Date: Mon, 29 Aug 2022 17:50:26 -0400 Subject: [PATCH] re-export `cookie_store::CookieStore` --- README.md | 5 +++-- src/lib.rs | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 23a30e1..51452b1 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ `reqwest_cookie_store` provides implementations of `reqwest::cookie::CookieStore` for [cookie_store](https://crates.io/crates/cookie_store). # Example -The following example demonstrates loading a `cookie_store::CookieStore` from disk, and using it within a +The following example demonstrates loading a `cookie_store::CookieStore` (re-exported in this crate) from disk, and using it within a `CookieStoreMutex`. It then makes a series of requests, examining and modifying the contents of the underlying `cookie_store::CookieStore` in between. @@ -13,7 +13,8 @@ let cookie_store = { let file = std::fs::File::open("cookies.json") .map(std::io::BufReader::new) .unwrap(); - cookie_store::CookieStore::load_json(file).unwrap() + // use re-exported version of `CookieStore` for crate compatibility + reqwest_cookie_store::CookieStore::load_json(file).unwrap() }; let cookie_store = reqwest_cookie_store::CookieStoreMutex::new(cookie_store); let cookie_store = std::sync::Arc::new(cookie_store); diff --git a/src/lib.rs b/src/lib.rs index 696a5f4..524070c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ #![deny(warnings, missing_debug_implementations, rust_2018_idioms)] #![cfg_attr(docsrs, feature(doc_cfg))] //! # Example -//! The following example demonstrates loading a [`cookie_store::CookieStore`] from disk, and using it within a +//! The following example demonstrates loading a [`cookie_store::CookieStore`] (re-exported in this crate) from disk, and using it within a //! [`CookieStoreMutex`]. It then makes a series of requests, examining and modifying the contents //! of the underlying [`cookie_store::CookieStore`] in between. //! ```no_run @@ -12,7 +12,8 @@ //! let file = std::fs::File::open("cookies.json") //! .map(std::io::BufReader::new) //! .unwrap(); -//! cookie_store::CookieStore::load_json(file).unwrap() +//! // use re-exported version of `CookieStore` for crate compatibility +//! reqwest_cookie_store::CookieStore::load_json(file).unwrap() //! }; //! let cookie_store = reqwest_cookie_store::CookieStoreMutex::new(cookie_store); //! let cookie_store = std::sync::Arc::new(cookie_store); @@ -80,7 +81,7 @@ use std::{ use bytes::Bytes; use cookie::{Cookie as RawCookie, ParseError as RawCookieParseError}; -use cookie_store::CookieStore; +pub use cookie_store::CookieStore; use reqwest::header::HeaderValue; use url;