[pbs-devel] [PATCH proxmox 13/19] rest-server/router: ignore type complexity clippy lint

Shannon Sterz s.sterz at proxmox.com
Thu Mar 6 13:43:43 CET 2025


the `type_complexity` clippy lint [1] is intended to make the code
more legible in most cases. however, the lint triggers on a member of
a private enum, an example minimal rest server and a private static
variable here. so the benefits of declaring a new type that would
encapsulate this complexity is minimal. hence, ignore the warnings for
now.

[1]:
https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
 proxmox-acme-api/src/challenge_schemas.rs           | 1 +
 proxmox-rest-server/examples/minimal-rest-server.rs | 1 +
 proxmox-router/src/stream/parsing.rs                | 1 +
 3 files changed, 3 insertions(+)

diff --git a/proxmox-acme-api/src/challenge_schemas.rs b/proxmox-acme-api/src/challenge_schemas.rs
index 40a6a6af..e66e327e 100644
--- a/proxmox-acme-api/src/challenge_schemas.rs
+++ b/proxmox-acme-api/src/challenge_schemas.rs
@@ -49,6 +49,7 @@ fn load_dns_challenge_schema() -> Result<Vec<AcmeChallengeSchema>, Error> {
 }
 
 pub fn get_cached_challenge_schemas() -> Result<ChallengeSchemaWrapper, Error> {
+    #[allow(clippy::type_complexity)]
     static CACHE: LazyLock<Mutex<Option<(Arc<Vec<AcmeChallengeSchema>>, SystemTime)>>> =
         LazyLock::new(|| Mutex::new(None));
 
diff --git a/proxmox-rest-server/examples/minimal-rest-server.rs b/proxmox-rest-server/examples/minimal-rest-server.rs
index d6a5f2eb..23be586c 100644
--- a/proxmox-rest-server/examples/minimal-rest-server.rs
+++ b/proxmox-rest-server/examples/minimal-rest-server.rs
@@ -31,6 +31,7 @@ impl UserInformation for DummyUserInfo {
     }
 }
 
+#[allow(clippy::type_complexity)]
 fn check_auth<'a>(
     _headers: &'a HeaderMap,
     _method: &'a Method,
diff --git a/proxmox-router/src/stream/parsing.rs b/proxmox-router/src/stream/parsing.rs
index 69ae1994..1726d2f8 100644
--- a/proxmox-router/src/stream/parsing.rs
+++ b/proxmox-router/src/stream/parsing.rs
@@ -60,6 +60,7 @@ where
 
 enum RecordsInner<R: Send + Sync> {
     New(R),
+    #[allow(clippy::type_complexity)]
     Reading(Pin<Box<dyn Future<Output = io::Result<Option<(Vec<u8>, R)>>> + Send + Sync>>),
     Done,
 }
-- 
2.39.5





More information about the pbs-devel mailing list