Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/cargo-util-schemas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions crates/cargo-util-schemas/src/restricted_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_add/crate_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down