Open
Description
Summary
Actix Web (https://crates.io/crates/actix-web) supports wildcard in their HTTP route definition macro. It looks something like #[post("/path/{variable:.*}")]
. This triggers literal_string_with_formatting_args
incorrectly.
As a work around we're adding #![allow(clippy::literal_string_with_formatting_args)]
to all our files.
Lint Name
literal_string_with_formatting_args
Reproducer
I tried this code:
use actix_web::{post, HttpRequest, HttpResponse};
#[post("/path/{variable:.*}")]
pub async fn my_route(req: HttpRequest) -> HttpResponse {
Ok(HttpResponse::Ok())
}
Creates (roughly) the following error:
error: this looks like a formatting argument but it is not part of a formatting macro
--> path.rs:1
|
1 | #[post("/path/{variable:.*}")]
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args
= note: `-D clippy::literal-string-with-formatting-args` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::literal_string_with_formatting_args)]`
Version
rustc 1.85.0-nightly (45d11e51b 2025-01-01)
binary: rustc
commit-hash: 45d11e51bb66c2deb63a006fe3953c4b6fbc50c2
commit-date: 2025-01-01
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.6
Additional Labels
No response