From a30be469ef671bccd683e011824bd1e69420b92c Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Sat, 26 Sep 2020 14:01:48 -0700 Subject: [PATCH] client: ignore rc_buffer clippy warning This new lint popped up overnight, see https://github.com/rust-lang/rust-clippy/pull/6044 The problem is that we do indeed want this structure. - The outer Arc allows us to clone in .send() without cloning the array. - The Vec allows us to add middleware at runtime. - The inner Arc-s allow us to implement Clone without sharing the vector with the parent. - We don't use a Mutex around the Vec here because adding a middleware during execution should be an error. --- src/client.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client.rs b/src/client.rs index 74983e7..8c4db6a 100644 --- a/src/client.rs +++ b/src/client.rs @@ -37,6 +37,13 @@ pub struct Client { base_url: Option, http_client: Arc, /// Holds the middleware stack. + /// + /// Note(Fishrock123): We do actually want this structure. + /// The outer Arc allows us to clone in .send() without cloning the array. + /// The Vec allows us to add middleware at runtime. + /// The inner Arc-s allow us to implement Clone without sharing the vector with the parent. + /// We don't use a Mutex around the Vec here because adding a middleware during execution should be an error. + #[allow(clippy::rc_buffer)] middleware: Arc>>, }