Replace unicode-xid with unicode-ident crate

This commit is contained in:
David Tolnay 2022-05-16 15:28:43 -07:00
parent fd1a51c69f
commit be107389d4
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 4 additions and 6 deletions

View File

@ -36,9 +36,9 @@ proc-macro = ["proc-macro2/proc-macro", "quote/proc-macro"]
test = ["syn-test-suite/all-features"]
[dependencies]
proc-macro2 = { version = "1.0.32", default-features = false }
proc-macro2 = { version = "1.0.39", default-features = false }
quote = { version = "1.0", optional = true, default-features = false }
unicode-xid = "0.2"
unicode-ident = "1.0"
[dev-dependencies]
anyhow = "1.0"

View File

@ -6,7 +6,6 @@ use crate::lookahead;
use crate::parse::{Parse, ParseStream, Result};
#[cfg(feature = "parsing")]
use crate::token::Token;
use unicode_xid::UnicodeXID;
pub use proc_macro2::Ident;
@ -90,11 +89,11 @@ impl From<Token![_]> for Ident {
pub fn xid_ok(symbol: &str) -> bool {
let mut chars = symbol.chars();
let first = chars.next().unwrap();
if !(first == '_' || UnicodeXID::is_xid_start(first)) {
if !(first == '_' || unicode_ident::is_xid_start(first)) {
return false;
}
for ch in chars {
if !UnicodeXID::is_xid_continue(ch) {
if !unicode_ident::is_xid_continue(ch) {
return false;
}
}

View File

@ -310,7 +310,6 @@
))]
extern crate proc_macro;
extern crate proc_macro2;
extern crate unicode_xid;
#[cfg(feature = "printing")]
extern crate quote;