Skip to content

Commit

Permalink
codegen: Ignore clippy::literal_string_with_formatting_args lint
Browse files Browse the repository at this point in the history
```
error: this looks like a formatting argument but it is not part of a formatting macro
   --> tools/codegen/src/main.rs:142:65
    |
142 | ...                   d.url = Some(template.url.replace("${version}", version));
    |                                                           ^^^^^^^^^
    |
    = 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)]`

error: this looks like a formatting argument but it is not part of a formatting macro
   --> tools/codegen/src/main.rs:146:64
    |
146 | ...                   .map(|s| s.map(|s| s.replace("${version}", version)));
    |                                                      ^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args

error: this looks like a formatting argument but it is not part of a formatting macro
   --> tools/codegen/src/main.rs:567:73
    |
567 |             let template_url = d.url.take().unwrap().replace(version, "${version}");
    |                                                                         ^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args

error: this looks like a formatting argument but it is not part of a formatting macro
   --> tools/codegen/src/main.rs:568:84
    |
568 |             let template_bin = d.bin.take().map(|s| s.map(|s| s.replace(version, "${version}")));
    |                                                                                    ^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args

error: this looks like a formatting argument but it is not part of a formatting macro
   --> tools/codegen/src/main.rs:615:29
    |
615 |     let mut s = s.replace("${package}", package).replace("${tool}", package);
    |                             ^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args

error: this looks like a formatting argument but it is not part of a formatting macro
   --> tools/codegen/src/main.rs:625:25
    |
625 |         s = s.replace("${version}", version);
    |                         ^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#literal_string_with_formatting_args
```
  • Loading branch information
taiki-e committed Dec 27, 2024
1 parent acd2589 commit ab81fd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/codegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ fn main() -> Result<()> {
};
let version = &*k.0.to_string();
if let Some(template) = &manifests.template {
#[allow(clippy::literal_string_with_formatting_args)]
for (platform, d) in &mut manifest.download_info {
let template = &template.download_info[platform];
d.url = Some(template.url.replace("${version}", version));
Expand Down Expand Up @@ -600,6 +601,7 @@ fn write_manifests(manifest_path: &Path, manifests: &Manifests) -> Result<()> {
Ok(())
}

#[allow(clippy::literal_string_with_formatting_args)]
fn replace_vars(
s: &str,
package: &str,
Expand Down

0 comments on commit ab81fd1

Please sign in to comment.