Skip to content

Commit 4f53b20

Browse files
committed
fix: fix clippy warnings
1 parent ac227b8 commit 4f53b20

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

macros/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub fn match_byte(input: TokenStream) -> TokenStream {
162162
for (i, ref arm) in arms.iter().enumerate() {
163163
let case_id = i + 1;
164164
let index = case_id as isize;
165-
let name = syn::Ident::new(&format!("Case{}", case_id), arm.span());
165+
let name = syn::Ident::new(&format!("Case{case_id}"), arm.span());
166166
let pat = &arm.pat;
167167
parse_pat_to_table(pat, case_id as u8, &mut wildcard, &mut table);
168168

@@ -177,7 +177,7 @@ pub fn match_byte(input: TokenStream) -> TokenStream {
177177

178178
let mut table_content = Vec::new();
179179
for entry in table.iter() {
180-
let name: syn::Path = syn::parse_str(&format!("Case::Case{}", entry)).unwrap();
180+
let name: syn::Path = syn::parse_str(&format!("Case::Case{entry}")).unwrap();
181181
table_content.push(name);
182182
}
183183
let table = quote::quote!(static __CASES: [Case; 256] = [#(#table_content),*];);

src/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ impl fmt::Display for BasicParseErrorKind<'_> {
8080
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8181
match self {
8282
BasicParseErrorKind::UnexpectedToken(token) => {
83-
write!(f, "unexpected token: {:?}", token)
83+
write!(f, "unexpected token: {token:?}")
8484
}
8585
BasicParseErrorKind::EndOfInput => write!(f, "unexpected end of input"),
8686
BasicParseErrorKind::AtRuleInvalid(rule) => {
87-
write!(f, "invalid @ rule encountered: '@{}'", rule)
87+
write!(f, "invalid @ rule encountered: '@{rule}'")
8888
}
8989
BasicParseErrorKind::AtRuleBodyInvalid => write!(f, "invalid @ rule body encountered"),
9090
BasicParseErrorKind::QualifiedRuleInvalid => {

src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ fn delimiter_from_byte(b: &mut Bencher) {
794794
}
795795

796796
#[cfg(feature = "bench")]
797-
const BACKGROUND_IMAGE: &'static str = include_str!("big-data-url.css");
797+
const BACKGROUND_IMAGE: &str = include_str!("big-data-url.css");
798798

799799
#[cfg(feature = "bench")]
800800
#[bench]

src/tokenizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ enum SeenStatus {
229229

230230
impl<'a> Tokenizer<'a> {
231231
#[inline]
232-
pub fn new(input: &str) -> Tokenizer {
232+
pub fn new(input: &'a str) -> Tokenizer<'a> {
233233
Tokenizer {
234234
input,
235235
position: 0,

0 commit comments

Comments
 (0)