From 3b4909ccd910b96c61495a65667d436a7aab42ec Mon Sep 17 00:00:00 2001 From: Cylenia Date: Sat, 11 Oct 2025 17:37:44 +0100 Subject: [PATCH] Fix grammar mistake in bad Cargo.toml name error. --- src/cargo/ops/cargo_install.rs | 2 +- src/cargo/sources/path.rs | 2 +- src/cargo/util/important_paths.rs | 4 ++-- tests/testsuite/build.rs | 2 +- tests/testsuite/install.rs | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cargo/ops/cargo_install.rs b/src/cargo/ops/cargo_install.rs index 466702903f1..edbb56c10e7 100644 --- a/src/cargo/ops/cargo_install.rs +++ b/src/cargo/ops/cargo_install.rs @@ -127,7 +127,7 @@ impl<'gctx> InstallablePackage<'gctx> { ); } else if src.path().join("cargo.toml").exists() { bail!( - "`{}` does not contain a Cargo.toml file, but found cargo.toml please try to rename it to Cargo.toml. \ + "`{}` does not contain a Cargo.toml file, but does contain cargo.toml. Please try to rename it to Cargo.toml. \ --path must point to a directory containing a Cargo.toml file.", src.path().display() ) diff --git a/src/cargo/sources/path.rs b/src/cargo/sources/path.rs index 8e754e03fa9..8c51741f086 100644 --- a/src/cargo/sources/path.rs +++ b/src/cargo/sources/path.rs @@ -1042,7 +1042,7 @@ fn read_packages( None => { if find_project_manifest_exact(path, "cargo.toml").is_ok() { Err(anyhow::format_err!( - "Could not find Cargo.toml in `{}`, but found cargo.toml please try to rename it to Cargo.toml", + "Could not find Cargo.toml in `{}`, but found cargo.toml. Please try to rename it to Cargo.toml", path.display() )) } else { diff --git a/src/cargo/util/important_paths.rs b/src/cargo/util/important_paths.rs index 1a2771b8604..60b26105a08 100644 --- a/src/cargo/util/important_paths.rs +++ b/src/cargo/util/important_paths.rs @@ -20,13 +20,13 @@ pub fn find_root_manifest_for_wd(cwd: &Path) -> CargoResult { if invalid_cargo_toml_path_exists { anyhow::bail!( - "could not find `{}` in `{}` or any parent directory, but found cargo.toml please try to rename it to Cargo.toml", + "Could not find `{}` in `{}` or any parent directory, but found cargo.toml. Please try to rename it to Cargo.toml", valid_cargo_toml_file_name, cwd.display() ) } else { anyhow::bail!( - "could not find `{}` in `{}` or any parent directory", + "Could not find `{}` in `{}` or any parent directory", valid_cargo_toml_file_name, cwd.display() ) diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index 68a3a037911..3ff45ed6e5e 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -806,7 +806,7 @@ fn cargo_compile_with_lowercase_cargo_toml() { p.cargo("build") .with_status(101) .with_stderr_data(str![[r#" -[ERROR] could not find `Cargo.toml` in `[ROOT]/foo` or any parent directory, but found cargo.toml please try to rename it to Cargo.toml +[ERROR] could not find `Cargo.toml` in `[ROOT]/foo` or any parent directory, but found cargo.toml. Please try to rename it to Cargo.toml "#]]) .run(); diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index ae1a2d89d1e..81f63814310 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -554,7 +554,7 @@ fn install_path_with_lowercase_cargo_toml() { cargo_process("install --path .") .with_status(101) .with_stderr_data(str![[r#" -[ERROR] `[ROOT]` does not contain a Cargo.toml file, but found cargo.toml please try to rename it to Cargo.toml. --path must point to a directory containing a Cargo.toml file. +[ERROR] `[ROOT]` does not contain a Cargo.toml file, but does contain cargo.toml. Please try to rename it to Cargo.toml. --path must point to a directory containing a Cargo.toml file. "#]] ) @@ -1064,7 +1064,7 @@ fn git_repo_with_lowercase_cargo_toml() { .with_status(101) .with_stderr_data(str![[r#" [UPDATING] git repository [..] -[ERROR] Could not find Cargo.toml in `[..]`, but found cargo.toml please try to rename it to Cargo.toml +[ERROR] Could not find Cargo.toml in `[..]`, but found cargo.toml. Please try to rename it to Cargo.toml "#]] )