From 87cdf12d3fbc175f1c5a6a06fd5940d6df75fed0 Mon Sep 17 00:00:00 2001 From: pfernie Date: Wed, 24 Jan 2024 12:29:41 -0500 Subject: [PATCH] doc: clarify Cookie API usage (#2111) `cookie_store` and `cookie_provider` both enable the cookie store functionality; clarify the usage and potential for a custom store being overwritten if both are used. --- src/async_impl/client.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/async_impl/client.rs b/src/async_impl/client.rs index f082d28bc..063060cb0 100644 --- a/src/async_impl/client.rs +++ b/src/async_impl/client.rs @@ -786,7 +786,11 @@ impl ClientBuilder { /// Cookies received in responses will be preserved and included in /// additional requests. /// - /// By default, no cookie store is used. + /// By default, no cookie store is used. Enabling the cookie store + /// with `cookie_store(true)` will set the store to a default implementation. + /// It is **not** necessary to call [cookie_store(true)](crate::ClientBuilder::cookie_store) if [cookie_provider(my_cookie_store)](crate::ClientBuilder::cookie_provider) + /// is used; calling [cookie_store(true)](crate::ClientBuilder::cookie_store) _after_ [cookie_provider(my_cookie_store)](crate::ClientBuilder::cookie_provider) will result + /// in the provided `my_cookie_store` being **overridden** with a default implementation. /// /// # Optional /// @@ -807,7 +811,10 @@ impl ClientBuilder { /// Cookies received in responses will be passed to this store, and /// additional requests will query this store for cookies. /// - /// By default, no cookie store is used. + /// By default, no cookie store is used. It is **not** necessary to also call + /// [cookie_store(true)](crate::ClientBuilder::cookie_store) if [cookie_provider(my_cookie_store)](crate::ClientBuilder::cookie_provider) is used; calling + /// [cookie_store(true)](crate::ClientBuilder::cookie_store) _after_ [cookie_provider(my_cookie_store)](crate::ClientBuilder::cookie_provider) will result + /// in the provided `my_cookie_store` being **overridden** with a default implementation. /// /// # Optional ///