From ac227b81cb4754d0acc7f5ec8fac485d6f9a98ea Mon Sep 17 00:00:00 2001 From: Cheng Xu Date: Wed, 6 Aug 2025 14:13:13 -0700 Subject: [PATCH 1/2] chore(deps): update phf to 0.12 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6604f20e..4addb931 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ encoding_rs = "0.8" cssparser-macros = { path = "./macros", version = "0.6.1" } dtoa-short = "0.3" itoa = "1.0" -phf = { version = "0.11.2", features = ["macros"] } +phf = { version = "0.12.1", features = ["macros"] } serde = { version = "1.0", features = ["derive"], optional = true } malloc_size_of = { version = "0.1", default-features = false, optional = true } smallvec = "1.0" From 6058e0d081b4d502d56f30554975743b9fa9c0f5 Mon Sep 17 00:00:00 2001 From: Cheng Xu Date: Sat, 9 Aug 2025 23:25:12 -0700 Subject: [PATCH 2/2] fix: fix clippy warnings --- macros/lib.rs | 4 ++-- src/parser.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/macros/lib.rs b/macros/lib.rs index 8b40bd4c..dc7b36e3 100644 --- a/macros/lib.rs +++ b/macros/lib.rs @@ -162,7 +162,7 @@ pub fn match_byte(input: TokenStream) -> TokenStream { for (i, ref arm) in arms.iter().enumerate() { let case_id = i + 1; let index = case_id as isize; - let name = syn::Ident::new(&format!("Case{}", case_id), arm.span()); + let name = syn::Ident::new(&format!("Case{case_id}"), arm.span()); let pat = &arm.pat; parse_pat_to_table(pat, case_id as u8, &mut wildcard, &mut table); @@ -177,7 +177,7 @@ pub fn match_byte(input: TokenStream) -> TokenStream { let mut table_content = Vec::new(); for entry in table.iter() { - let name: syn::Path = syn::parse_str(&format!("Case::Case{}", entry)).unwrap(); + let name: syn::Path = syn::parse_str(&format!("Case::Case{entry}")).unwrap(); table_content.push(name); } let table = quote::quote!(static __CASES: [Case; 256] = [#(#table_content),*];); diff --git a/src/parser.rs b/src/parser.rs index aabeea6a..8b436420 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -80,11 +80,11 @@ impl fmt::Display for BasicParseErrorKind<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { BasicParseErrorKind::UnexpectedToken(token) => { - write!(f, "unexpected token: {:?}", token) + write!(f, "unexpected token: {token:?}") } BasicParseErrorKind::EndOfInput => write!(f, "unexpected end of input"), BasicParseErrorKind::AtRuleInvalid(rule) => { - write!(f, "invalid @ rule encountered: '@{}'", rule) + write!(f, "invalid @ rule encountered: '@{rule}'") } BasicParseErrorKind::AtRuleBodyInvalid => write!(f, "invalid @ rule body encountered"), BasicParseErrorKind::QualifiedRuleInvalid => {