From 987d6cb6a7ef666b796554ae909fb85cd092b351 Mon Sep 17 00:00:00 2001 From: ump45nose <52391318+ump45nose@users.noreply.github.com> Date: Fri, 2 Oct 2026 22:51:36 +0800 Subject: [PATCH] style: remove useless_borrows_in_formatting from the clippy allowlist Fix the two remaining violations in src/proto/h1/decode.rs by inlining the header variable into the format string, which also satisfies the uninlined_format_args lint that the old &header borrow was dodging. Refs: #4071 --- Cargo.toml | 1 - src/proto/h1/decode.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e9ca2c890c..12cfa31f4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -136,7 +136,6 @@ unnested_or_patterns = "allow" unused_async = "allow" # TODO: is it for API? unused_trait_names = "allow" # TODO: kinda annoying, but might be good to deny unwrap_in_result = "allow" -useless_borrows_in_formatting = "allow" wildcard_enum_match_arm = "allow" definition_in_module_root = "allow" unnecessary_rest_pattern = "allow" diff --git a/src/proto/h1/decode.rs b/src/proto/h1/decode.rs index fe2c8d9cdf..9d8ed7f408 100644 --- a/src/proto/h1/decode.rs +++ b/src/proto/h1/decode.rs @@ -652,7 +652,7 @@ fn decode_trailers(buf: &mut BytesMut, count: usize) -> Result { return Err(io::Error::new( io::ErrorKind::InvalidInput, - format!("Invalid header name: {:?}", &header), + format!("Invalid header name: {header:?}"), )); } }; @@ -662,7 +662,7 @@ fn decode_trailers(buf: &mut BytesMut, count: usize) -> Result { return Err(io::Error::new( io::ErrorKind::InvalidInput, - format!("Invalid header value: {:?}", &header), + format!("Invalid header value: {header:?}"), )); } };