Skip to content

Commit ccc62b7

Browse files
authored
fix: Resolve new clippy warning about using variables directly in format strings (#590)
1 parent 4094dec commit ccc62b7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

common/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2897,7 +2897,7 @@ mod tests {
28972897
});
28982898

28992899
assert_eq!(
2900-
&format!("{:?}", node),
2900+
&format!("{node:?}"),
29012901
r#"Node { role: Unknown, actions: [Click, Focus], is_hidden: true, is_multiselectable: true, children: [#0, #1], active_descendant: #2, custom_actions: [CustomAction { id: 0, description: "test action" }] }"#
29022902
);
29032903
}

consumer/src/tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl<T> fmt::Display for ShortNodeList<'_, T> {
361361
if i != 0 {
362362
write!(f, ", ")?;
363363
}
364-
write!(f, "{:?}", id)?;
364+
write!(f, "{id:?}")?;
365365
}
366366
if iter.next().is_some() {
367367
write!(f, " ...")?;

platforms/macos/src/patch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ where
7474
types.as_ptr(),
7575
)
7676
});
77-
assert!(success.as_bool(), "Failed to add method {:?}", sel);
77+
assert!(success.as_bool(), "Failed to add method {sel:?}");
7878
}
7979

8080
fn count_args(sel: Sel) -> usize {
@@ -86,7 +86,7 @@ fn method_type_encoding(ret: &Encoding, args: &[Encoding]) -> CString {
8686
let mut types = format!("{}{}{}", ret, <*mut AnyObject>::ENCODING, Sel::ENCODING);
8787
for enc in args {
8888
use core::fmt::Write;
89-
write!(&mut types, "{}", enc).unwrap();
89+
write!(&mut types, "{enc}").unwrap();
9090
}
9191
CString::new(types).unwrap()
9292
}

0 commit comments

Comments
 (0)