Skip to content

Commit

Permalink
Replace unicode-xid with unicode-ident crate
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 16, 2022
1 parent fd1a51c commit be10738
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@
))]
extern crate proc_macro;
extern crate proc_macro2;
extern crate unicode_xid;

#[cfg(feature = "printing")]
extern crate quote;
Expand Down

0 comments on commit be10738

Please sign in to comment.