From 12c596449d8ce900a0ab537077edab6fb9b64c29 Mon Sep 17 00:00:00 2001 From: Alexander Lyon Date: Tue, 9 Apr 2024 16:34:45 +0100 Subject: [PATCH] add clone docs for strategy (closes #520) --- src/client/stripe.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/client/stripe.rs b/src/client/stripe.rs index d3b0aa23d..90a159869 100644 --- a/src/client/stripe.rs +++ b/src/client/stripe.rs @@ -59,6 +59,16 @@ impl Client { } /// Set the request strategy for the client. + /// + /// Note: the client is cheap to clone so if you require a new client + /// temporarily with a new strategy you can simply clone it + /// and keep going. + /// + /// ```no_run + /// let idempotent_client = client + /// .clone() + /// .with_strategy(RequestStrategy::Idempotent("my-key".to_string())); + /// ``` pub fn with_strategy(mut self, strategy: RequestStrategy) -> Self { self.strategy = strategy; self