diff --git a/src/client.rs b/src/client.rs index 5e03f00..1d678aa 100644 --- a/src/client.rs +++ b/src/client.rs @@ -34,7 +34,11 @@ impl ClientCache { ) }); - f(client.1.clone()).await + // inner is ref-counted + let client_cloned = client.1.clone(); + drop(client); + + f(client_cloned).await } pub fn gc(&self, dur: std::time::Duration) {