From 930e7236ad916dc5a5817f598658d1335cab4d2e Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Wed, 2 Jul 2025 13:42:30 -0400 Subject: [PATCH 1/3] Ignore clippy's manual_is_multiple_of warning. unsigned_is_multiple_of() was stabilized very recently, and while the suggested code might be more idiomatic, it's not supported by our MSRV or even the stable version currently used in rules_rust. Signed-off-by: Piotr Sikora --- examples/grpc_auth_random/src/lib.rs | 1 + examples/http_auth_random/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/grpc_auth_random/src/lib.rs b/examples/grpc_auth_random/src/lib.rs index d1c589e9..b8d7db52 100644 --- a/examples/grpc_auth_random/src/lib.rs +++ b/examples/grpc_auth_random/src/lib.rs @@ -68,6 +68,7 @@ impl HttpContext for GrpcAuthRandom { impl Context for GrpcAuthRandom { fn on_grpc_call_response(&mut self, _: u32, status_code: u32, _: usize) { + #[allow(clippy::manual_is_multiple_of)] if status_code % 2 == 0 { info!("Access granted."); self.resume_http_request(); diff --git a/examples/http_auth_random/src/lib.rs b/examples/http_auth_random/src/lib.rs index b666ecef..3b020bb6 100644 --- a/examples/http_auth_random/src/lib.rs +++ b/examples/http_auth_random/src/lib.rs @@ -50,6 +50,7 @@ impl HttpContext for HttpAuthRandom { impl Context for HttpAuthRandom { fn on_http_call_response(&mut self, _: u32, _: usize, body_size: usize, _: usize) { if let Some(body) = self.get_http_call_response_body(0, body_size) { + #[allow(clippy::manual_is_multiple_of)] if !body.is_empty() && body[0] % 2 == 0 { info!("Access granted."); self.resume_http_request(); From 694da161282863569264bba82fddcb4c261776b1 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Wed, 2 Jul 2025 14:47:24 -0400 Subject: [PATCH 2/3] review: allow unknown lints. Signed-off-by: Piotr Sikora --- examples/grpc_auth_random/src/lib.rs | 1 + examples/http_auth_random/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/grpc_auth_random/src/lib.rs b/examples/grpc_auth_random/src/lib.rs index b8d7db52..b7af2096 100644 --- a/examples/grpc_auth_random/src/lib.rs +++ b/examples/grpc_auth_random/src/lib.rs @@ -68,6 +68,7 @@ impl HttpContext for GrpcAuthRandom { impl Context for GrpcAuthRandom { fn on_grpc_call_response(&mut self, _: u32, status_code: u32, _: usize) { + #[allow(unknown_lints)] #[allow(clippy::manual_is_multiple_of)] if status_code % 2 == 0 { info!("Access granted."); diff --git a/examples/http_auth_random/src/lib.rs b/examples/http_auth_random/src/lib.rs index 3b020bb6..ad79b22d 100644 --- a/examples/http_auth_random/src/lib.rs +++ b/examples/http_auth_random/src/lib.rs @@ -50,6 +50,7 @@ impl HttpContext for HttpAuthRandom { impl Context for HttpAuthRandom { fn on_http_call_response(&mut self, _: u32, _: usize, body_size: usize, _: usize) { if let Some(body) = self.get_http_call_response_body(0, body_size) { + #[allow(unknown_lints)] #[allow(clippy::manual_is_multiple_of)] if !body.is_empty() && body[0] % 2 == 0 { info!("Access granted."); From 7cad2f7f11b72a7c387893c16b1701012f8174c3 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Wed, 2 Jul 2025 15:07:14 -0400 Subject: [PATCH 3/3] review: style. Signed-off-by: Piotr Sikora --- examples/grpc_auth_random/src/lib.rs | 3 +-- examples/http_auth_random/src/lib.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/grpc_auth_random/src/lib.rs b/examples/grpc_auth_random/src/lib.rs index b7af2096..54d227b2 100644 --- a/examples/grpc_auth_random/src/lib.rs +++ b/examples/grpc_auth_random/src/lib.rs @@ -68,8 +68,7 @@ impl HttpContext for GrpcAuthRandom { impl Context for GrpcAuthRandom { fn on_grpc_call_response(&mut self, _: u32, status_code: u32, _: usize) { - #[allow(unknown_lints)] - #[allow(clippy::manual_is_multiple_of)] + #[allow(unknown_lints, clippy::manual_is_multiple_of)] if status_code % 2 == 0 { info!("Access granted."); self.resume_http_request(); diff --git a/examples/http_auth_random/src/lib.rs b/examples/http_auth_random/src/lib.rs index ad79b22d..4e539713 100644 --- a/examples/http_auth_random/src/lib.rs +++ b/examples/http_auth_random/src/lib.rs @@ -50,8 +50,7 @@ impl HttpContext for HttpAuthRandom { impl Context for HttpAuthRandom { fn on_http_call_response(&mut self, _: u32, _: usize, body_size: usize, _: usize) { if let Some(body) = self.get_http_call_response_body(0, body_size) { - #[allow(unknown_lints)] - #[allow(clippy::manual_is_multiple_of)] + #[allow(unknown_lints, clippy::manual_is_multiple_of)] if !body.is_empty() && body[0] % 2 == 0 { info!("Access granted."); self.resume_http_request();