Fix easy clippy lints from latest stable (#16053)

1.88.0 was released today, clippy now lints (machine-applicable)
against:
- format strings with empty braces that could be inlined
  - easy win
- `manual_abs_diff`
- returning of a stored result of the last expression.
  - this can be somewhat contentious but touched only a few places
This commit is contained in:
Stefan Holderbach
2025-06-29 17:37:17 +02:00
committed by GitHub
parent 372d576846
commit 9da0f41ebb
102 changed files with 258 additions and 339 deletions

View File

@ -5,7 +5,7 @@ fn local_socket_path_contains_pid() {
let name = make_local_socket_name("test-string")
.to_string_lossy()
.into_owned();
println!("{}", name);
println!("{name}");
assert!(name.to_string().contains(&std::process::id().to_string()));
}
@ -14,6 +14,6 @@ fn local_socket_path_contains_provided_name() {
let name = make_local_socket_name("test-string")
.to_string_lossy()
.into_owned();
println!("{}", name);
println!("{name}");
assert!(name.to_string().contains("test-string"));
}

View File

@ -201,7 +201,7 @@ fn reader_drop() {
impl WriteStreamMessage for Check {
fn write_stream_message(&mut self, msg: StreamMessage) -> Result<(), ShellError> {
assert!(matches!(msg, StreamMessage::Drop(1)), "got {:?}", msg);
assert!(matches!(msg, StreamMessage::Drop(1)), "got {msg:?}");
self.0.store(true, Relaxed);
Ok(())
}

View File

@ -122,8 +122,7 @@ mod tests {
let string = std::str::from_utf8(&out).expect("utf-8 error");
assert!(
string.ends_with('\n'),
"doesn't end with newline: {:?}",
string
"doesn't end with newline: {string:?}"
);
}