Skip to content

Commit

Permalink
Fix warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
Shankar Mathiah Nanjundan authored and Shankar Mathiah Nanjundan committed Oct 14, 2023
1 parent 1992803 commit 337092c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ fn check_name(
let name_in_lowercase = name.to_lowercase();
if name != name_in_lowercase {
shell.warn(format!(
"package `{}` should have a lowercase name such as `{}`",
name, name_in_lowercase
"the name `{name}` is not snake_case or kebab-case which is recommended for package names, consider `{name_in_lowercase}`"
))?;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ fn non_ascii_name() {
"\
[WARNING] the name `Привет` contains non-ASCII characters
Non-ASCII crate names are not supported by Rust.
[WARNING] package `Привет` should have a lowercase name such as `привет`
[WARNING] the name `Привет` is not snake_case or kebab-case which is recommended for package names, consider `привет`
[CREATED] binary (application) `Привет` package
",
)
Expand Down Expand Up @@ -507,7 +507,7 @@ fn non_snake_case_name() {
cargo_process("new UPPERcase_name")
.with_stderr(
"\
[WARNING] package `UPPERcase_name` should have a lowercase name such as `uppercase_name`
[WARNING] the name `UPPERcase_name` is not snake_case or kebab-case which is recommended for package names, consider `uppercase_name`
[CREATED] binary (application) `UPPERcase_name` package
",
)
Expand Down

0 comments on commit 337092c

Please sign in to comment.