Skip to content

Conversation

cylenia
Copy link

@cylenia cylenia commented Oct 11, 2025

What does this PR try to resolve?

A small grammar mistake in the error that shows when a Cargo.toml file can not be found, but a cargo.toml can.

@rustbot
Copy link
Collaborator

rustbot commented Oct 11, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-filesystem Area: issues with filesystems Command-install S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2025
@ranger-ross
Copy link
Member

From the rustc errors and lints style guide

The text should be matter of fact and avoid capitalization and periods, unless multiple sentences are needed

Though I do agree that the following is a run on sentence.

could not find `{}` in `{}` or any parent directory, but found cargo.toml please try to rename it to Cargo.toml

} 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. \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably add a help: and in the future we migrate to annotate-snippets

Suggested change
"`{}` does not contain a Cargo.toml file, but does contain cargo.toml. Please try to rename it to Cargo.toml. \
"`{}` does not contain a Cargo.toml file, but does contain cargo.toml\nhelp: try to rename it to Cargo.toml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this is more in line with the style guide:

Suggested change
"`{}` does not contain a Cargo.toml file, but does contain cargo.toml. Please try to rename it to Cargo.toml. \
"`{}` does not contain a `Cargo.toml` file
help: a `cargo.toml` exists

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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-filesystem Area: issues with filesystems Command-install S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants