Skip to content

Commit 8bb70a1

Browse files
committed
Migrate to using variables directly in format strings
`clippy` recently added a new lint that encourages the use of variables directly in format strings rather than as positional arguments. While its not the most critical thing, its right, so here we transition to inline variables in format strings.
1 parent bb2ef53 commit 8bb70a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning-macros/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn maybe_await(expr: TokenStream) -> TokenStream {
8383
fn expect_ident(token: &TokenTree, expected_name: Option<&str>) {
8484
if let TokenTree::Ident(id) = &token {
8585
if let Some(exp) = expected_name {
86-
assert_eq!(id.to_string(), exp, "Expected ident {}, got {:?}", exp, token);
86+
assert_eq!(id.to_string(), exp, "Expected ident {exp}, got {token:?}");
8787
}
8888
} else {
8989
panic!("Expected ident {:?}, got {:?}", expected_name, token);
@@ -92,9 +92,9 @@ fn expect_ident(token: &TokenTree, expected_name: Option<&str>) {
9292

9393
fn expect_punct(token: &TokenTree, expected: char) {
9494
if let TokenTree::Punct(p) = &token {
95-
assert_eq!(p.as_char(), expected, "Expected punctuation {}, got {}", expected, p);
95+
assert_eq!(p.as_char(), expected, "Expected punctuation {expected}, got {p}");
9696
} else {
97-
panic!("Expected punctuation {}, got {:?}", expected, token);
97+
panic!("Expected punctuation {expected}, got {token:?}");
9898
}
9999
}
100100

0 commit comments

Comments
 (0)