Skip to content

Commit 24954e2

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 #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 <[email protected]>
1 parent 617c120 commit 24954e2

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
@@ -826,11 +826,11 @@ impl Ident {
826826
}
827827

828828
pub(crate) fn is_ident_start(c: char) -> bool {
829-
c == '_' || unicode_ident::is_xid_start(c)
829+
c == '_' || c.is_ascii_alphabetic()
830830
}
831831

832832
pub(crate) fn is_ident_continue(c: char) -> bool {
833-
unicode_ident::is_xid_continue(c)
833+
c == '_' || c.is_ascii_alphanumeric()
834834
}
835835

836836
#[track_caller]

0 commit comments

Comments
 (0)