diff --git a/Cargo.lock b/Cargo.lock index ca2a8a030f8..cc61e370c18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -394,8 +394,8 @@ dependencies = [ "tracing-chrome", "tracing-subscriber", "unicase", + "unicode-ident", "unicode-width", - "unicode-xid", "url", "walkdir", "windows-sys 0.61.1", @@ -533,7 +533,7 @@ dependencies = [ "snapbox", "thiserror 2.0.17", "toml", - "unicode-xid", + "unicode-ident", "url", ] @@ -4731,9 +4731,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06" [[package]] name = "unicode-normalization" diff --git a/Cargo.toml b/Cargo.toml index 5f1830ddf34..35b9fcb25e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -112,9 +112,8 @@ tracing = { version = "0.1.41", default-features = false, features = ["std"] } # tracing-chrome = "0.7.2" tracing-subscriber = { version = "0.3.20", features = ["env-filter"] } unicase = "2.8.1" -unicode-ident = "1.0.19" +unicode-ident = "1.0.20" unicode-width = "0.2.1" -unicode-xid = "0.2.6" url = "2.5.7" varisat = "0.2.2" walkdir = "2.5.0" @@ -219,7 +218,7 @@ tracing = { workspace = true, features = ["attributes"] } tracing-subscriber.workspace = true unicase.workspace = true unicode-width.workspace = true -unicode-xid.workspace = true +unicode-ident.workspace = true url.workspace = true walkdir.workspace = true winnow.workspace = true diff --git a/crates/cargo-util-schemas/Cargo.toml b/crates/cargo-util-schemas/Cargo.toml index 649d8c78ba2..45cdb575d89 100644 --- a/crates/cargo-util-schemas/Cargo.toml +++ b/crates/cargo-util-schemas/Cargo.toml @@ -17,7 +17,7 @@ serde-untagged.workspace = true serde-value.workspace = true thiserror.workspace = true toml = { workspace = true, features = ["serde"] } -unicode-xid.workspace = true +unicode-ident.workspace = true url.workspace = true [lints] diff --git a/crates/cargo-util-schemas/src/restricted_names.rs b/crates/cargo-util-schemas/src/restricted_names.rs index 18be53bda66..44c17a9968c 100644 --- a/crates/cargo-util-schemas/src/restricted_names.rs +++ b/crates/cargo-util-schemas/src/restricted_names.rs @@ -61,7 +61,7 @@ pub(crate) fn validate_name(name: &str, what: &'static str) -> Result<()> { } .into()); } - if !(unicode_xid::UnicodeXID::is_xid_start(ch) || ch == '_') { + if !(unicode_ident::is_xid_start(ch) || ch == '_') { return Err(ErrorKind::InvalidCharacter { ch, what, @@ -73,7 +73,7 @@ pub(crate) fn validate_name(name: &str, what: &'static str) -> Result<()> { } } for ch in chars { - if !(unicode_xid::UnicodeXID::is_xid_continue(ch) || ch == '-') { + if !(unicode_ident::is_xid_continue(ch) || ch == '-') { return Err(ErrorKind::InvalidCharacter { ch, what, @@ -103,13 +103,13 @@ pub(crate) fn sanitize_name(name: &str, placeholder: char) -> String { let mut slug = String::new(); let mut chars = name.chars(); while let Some(ch) = chars.next() { - if (unicode_xid::UnicodeXID::is_xid_start(ch) || ch == '_') && !ch.is_digit(10) { + if (unicode_ident::is_xid_start(ch) || ch == '_') && !ch.is_digit(10) { slug.push(ch); break; } } while let Some(ch) = chars.next() { - if unicode_xid::UnicodeXID::is_xid_continue(ch) || ch == '-' { + if unicode_ident::is_xid_continue(ch) || ch == '-' { slug.push(ch); } else { slug.push(placeholder); @@ -212,7 +212,7 @@ pub(crate) fn validate_feature_name(name: &str) -> Result<()> { } let mut chars = name.chars(); if let Some(ch) = chars.next() { - if !(unicode_xid::UnicodeXID::is_xid_start(ch) || ch == '_' || ch.is_digit(10)) { + if !(unicode_ident::is_xid_start(ch) || ch == '_' || ch.is_digit(10)) { return Err(ErrorKind::InvalidCharacter { ch, what, @@ -224,7 +224,7 @@ pub(crate) fn validate_feature_name(name: &str) -> Result<()> { } } for ch in chars { - if !(unicode_xid::UnicodeXID::is_xid_continue(ch) || ch == '-' || ch == '+' || ch == '.') { + if !(unicode_ident::is_xid_continue(ch) || ch == '-' || ch == '+' || ch == '.') { return Err(ErrorKind::InvalidCharacter { ch, what, diff --git a/src/bin/cargo/commands/install.rs b/src/bin/cargo/commands/install.rs index 7668b376c64..cd946c9b378 100644 --- a/src/bin/cargo/commands/install.rs +++ b/src/bin/cargo/commands/install.rs @@ -137,7 +137,7 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult { let package_name = PackageName::new(crate_name); if !crate_name.contains("@") && package_name.is_err() { for (idx, ch) in crate_name.char_indices() { - if !(unicode_xid::UnicodeXID::is_xid_continue(ch) || ch == '-') { + if !(unicode_ident::is_xid_continue(ch) || ch == '-') { let mut suggested_crate_name = crate_name.to_string(); suggested_crate_name.insert_str(idx, "@"); if let Ok((_, Some(_))) = parse_crate(&suggested_crate_name.as_str()) { diff --git a/src/cargo/ops/cargo_add/crate_spec.rs b/src/cargo/ops/cargo_add/crate_spec.rs index 93887d41461..d7aeddd0615 100644 --- a/src/cargo/ops/cargo_add/crate_spec.rs +++ b/src/cargo/ops/cargo_add/crate_spec.rs @@ -31,7 +31,7 @@ impl CrateSpec { let package_name = PackageName::new(name); if !pkg_id.contains("@") && package_name.is_err() { for (idx, ch) in pkg_id.char_indices() { - if !(unicode_xid::UnicodeXID::is_xid_continue(ch) || ch == '-') { + if !(unicode_ident::is_xid_continue(ch) || ch == '-') { let mut suggested_pkg_id = pkg_id.to_string(); suggested_pkg_id.insert_str(idx, "@"); if let Ok(_) = CrateSpec::resolve(&suggested_pkg_id.as_str()) {