From 3eb095d08fe6f7a13c491a730bd07ed5d0801786 Mon Sep 17 00:00:00 2001 From: Patrick Fernie Date: Sat, 17 Jun 2023 11:49:44 -0400 Subject: [PATCH] doc: update doctest to use `CookieStore::new()` in example --- src/lib.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5aa7b36..d841965 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,11 +9,16 @@ //! # tokio_test::block_on(async { //! // Load an existing set of cookies, serialized as json //! let cookie_store = { -//! let file = std::fs::File::open("cookies.json") +//! if let Ok(file) = std::fs::File::open("cookies.json") //! .map(std::io::BufReader::new) -//! .unwrap(); -//! // use re-exported version of `CookieStore` for crate compatibility -//! reqwest_cookie_store::CookieStore::load_json(file).unwrap() +//! { +//! // use re-exported version of `CookieStore` for crate compatibility +//! reqwest_cookie_store::CookieStore::load_json(file).unwrap() +//! } +//! else +//! { +//! reqwest_cookie_store::CookieStore::new(None) +//! } //! }; //! let cookie_store = reqwest_cookie_store::CookieStoreMutex::new(cookie_store); //! let cookie_store = std::sync::Arc::new(cookie_store);