Skip to content

Commit 2c93fa5

Browse files
committed
rust: proc-macro2: remove unicode_ident dependency
The `proc-macro2` crate depends on the `unicode-ident` crate to determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex torvalds#31. However, we only need ASCII identifiers in the kernel, thus we can simplify the check and remove completely that dependency. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent a5b2c4c commit 2c93fa5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust/proc-macro2/fallback.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,11 +818,11 @@ impl Ident {
818818
}
819819

820820
pub(crate) fn is_ident_start(c: char) -> bool {
821-
c == '_' || unicode_ident::is_xid_start(c)
821+
c == '_' || c.is_ascii_alphabetic()
822822
}
823823

824824
pub(crate) fn is_ident_continue(c: char) -> bool {
825-
unicode_ident::is_xid_continue(c)
825+
c == '_' || c.is_ascii_alphanumeric()
826826
}
827827

828828
#[track_caller]

0 commit comments

Comments
 (0)