Skip to content
Myr

Ignore uninlined_format_args pedantic clippy lint in test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

warning: variables can be used directly in the `format!` string --> build.rs:200:9 | 200 | / eprintln!( 201 | | "Environment variable ${} is not set during execution of build script", 202 | | key, 203 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]` warning: variables can be used directly in the `format!` string --> src/ensure.rs:83:33 | 83 | if fmt::write(&mut lhs_buf, format_args!("{:?}", lhs)).is_ok() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]` help: change this to | 83 - if fmt::write(&mut lhs_buf, format_args!("{:?}", lhs)).is_ok() { 83 + if fmt::write(&mut lhs_buf, format_args!("{lhs:?}")).is_ok() { | warning: variables can be used directly in the `format!` string --> src/ensure.rs:85:37 | 85 | if fmt::write(&mut rhs_buf, format_args!("{:?}", rhs)).is_ok() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 85 - if fmt::write(&mut rhs_buf, format_args!("{:?}", rhs)).is_ok() { 85 + if fmt::write(&mut rhs_buf, format_args!("{rhs:?}")).is_ok() { | warning: variables can be used directly in the `format!` string --> src/fmt.rs:13:17 | 13 | write!(f, ": {}", cause)?; | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 13 - write!(f, ": {}", cause)?; 13 + write!(f, ": {cause}")?; | warning: variables can be used directly in the `format!` string --> src/fmt.rs:27:9 | 27 | write!(f, "{}", error)?; | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 27 - write!(f, "{}", error)?; 27 + write!(f, "{error}")?; | warning: variables can be used directly in the `format!` string --> src/fmt.rs:39:17 | 39 | write!(indented, "{}", error)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 39 - write!(indented, "{}", error)?; 39 + write!(indented, "{error}")?; | warning: variables can be used directly in the `format!` string --> src/fmt.rs:61:17 | 61 | write!(f, "{}", backtrace)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 61 - write!(f, "{}", backtrace)?; 61 + write!(f, "{backtrace}")?; | warning: variables can be used directly in the `format!` string --> src/fmt.rs:84:37 | 84 | Some(number) => write!(self.inner, "{: >5}: ", number)?, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 84 - Some(number) => write!(self.inner, "{: >5}: ", number)?, 84 + Some(number) => write!(self.inner, "{number: >5}: ")?, | warning: variables can be used directly in the `format!` string --> tests/test_ffi.rs:7:5 | 7 | println!("{:?}", err); | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]` help: change this to | 7 - println!("{:?}", err); 7 + println!("{err:?}"); | warning: variables can be used directly in the `format!` string --> tests/test_macros.rs:36:9 | 36 | ensure!(v + v == 2, "This is correct, v: {}", v); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]` help: change this to | 36 - ensure!(v + v == 2, "This is correct, v: {}", v); 36 + ensure!(v + v == 2, "This is correct, v: {v}"); | warning: variables can be used directly in the `format!` string --> tests/test_macros.rs:42:9 | 42 | ensure!(v + v == 1, "This is not correct, v: {}", v); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 42 - ensure!(v + v == 1, "This is not correct, v: {}", v); 42 + ensure!(v + v == 1, "This is not correct, v: {v}"); | warning: variables can be used directly in the `format!` string --> tests/test_ensure.rs:503:22 | 503 | let test = || Ok(ensure!("" == format!("{:#?}", point))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]` help: change this to | 503 - let test = || Ok(ensure!("" == format!("{:#?}", point))); 503 + let test = || Ok(ensure!("" == format!("{point:#?}"))); |

authored by David Tolnay · committed by David Tolnay · parent cb40ffb · Browse files · 5 files+6 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+6 added−0 removed

  • tests:+3 added−0 removed
  • other:+3 added−0 removed

5 files+6 added−0 removed

modified:src/lib.rs+1 added
226 unmodified lines
227 clippy::new_ret_no_self,228 clippy::redundant_else,229 clippy::return_self_not_must_use,230 clippy::struct_field_names,231 clippy::uninlined_format_args,232 clippy::unused_self,233 clippy::used_underscore_binding,234 clippy::wildcard_imports,235 clippy::wrong_self_convention
492 unmodified lines
modified:tests/test_ensure.rs+1 added
17 unmodified lines
18 clippy::overly_complex_bool_expr,19 clippy::redundant_closure_call,20 clippy::redundant_pattern_matching,21 clippy::too_many_lines,22 clippy::uninlined_format_args,23 clippy::unit_arg,24 clippy::unnecessary_cast,25 clippy::while_immutable_condition,26 clippy::zero_ptr,
729 unmodified lines
modified:tests/test_ffi.rs+1 added
1#![deny(improper_ctypes, improper_ctypes_definitions)]2#![allow(clippy::uninlined_format_args)]34use anyhow::anyhow;56#[no_mangle]
13 unmodified lines
modified:tests/test_macros.rs+1 added
4 unmodified lines
5 clippy::items_after_statements,6 clippy::match_single_binding,7 clippy::needless_pass_by_value,8 clippy::shadow_unrelated,9 clippy::uninlined_format_args,10 clippy::wildcard_imports11)]1213mod common;
84 unmodified lines
modified:build.rs+2 added
1#![allow(clippy::uninlined_format_args)]23use std::env;4use std::ffi::OsString;5use std::fs;6use std::io::ErrorKind;
202 unmodified lines