-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perhaps you meant: foo, bar or foobar #6550
Perhaps you meant: foo, bar or foobar #6550
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @dwijnand (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
7d5e006
to
2142b41
Compare
tests/testsuite/directory.rs
Outdated
@@ -189,7 +189,7 @@ error: failed to compile `bar v0.1.0`, intermediate artifacts can be found at `[ | |||
Caused by: | |||
no matching package named `baz` found | |||
location searched: registry `https://github.com/rust-lang/crates.io-index` | |||
did you mean: bar, foo | |||
did you mean: bar, foo? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the ?
would look better here before the colon? I'm a little worried about it accidentally looking like it's part of the crate name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking the same.
did you mean: bar, foo ?
did you mean? bar, foo
Perhaps you mean: bar, foo
Maybe variant without any questions is the best?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good to me! although it may want to be worded "perhaps you meant: foo, bar"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, perhaps you meant: foo, bar
looks good.
Alternatively we can quote them: did you mean: "bar", "foo"?
.
And, to be honest, I think we could also throw an "or" in there, so with 3 cases it would look like:
perhaps you meant: bar, foo, or baz
, ordid you mean: "bar", "foo", or "baz"?
(Oxford comma usage optional! 😉)
But I'd be happy to accept either of the first two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of "or", although I'd prefer to avoid using quotes as it makes it easier to copy/paste without them sometimes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcrichton @dwijnand What is your decision mighty Dictators?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go with perhaps you meant: bar, foo, baz
.
If you're feeling ambitious: perhaps you meant: bar, foo, or baz
😄
2142b41
to
a8a9169
Compare
I splitted this PR to two, so typo fix can be merged sooner :) |
a8a9169
to
74176ec
Compare
foo
, bar
or foobar
|acc, (i, el)| match i { | ||
0 => acc + el, | ||
i if names.len() - 1 == i && candidates.len() <= 3 => acc + " or " + el, | ||
_ => acc + ", " + el, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code idiomatic way to achieve what we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, but it looks like how I'd do it :)
74176ec
to
67dbfe5
Compare
foo
, bar
or foobar
Excellent, thank you! @bors: r+ |
📌 Commit 67dbfe5 has been approved by |
…nand Perhaps you meant: foo, bar or foobar Hi! Rust project is very cool, but I noticed some minor issues. In every place `did you mean: bla bla` end with the question mark, so I decided to include it here too.
☀️ Test successful - checks-travis, status-appveyor |
Update cargo Pull in fix for #57774. 6 commits in ffe65875fd05018599ad07e7389e99050c7915be..907c0febe7045fa02dff2a35c5e36d3bd59ea50d 2019-01-17 23:57:50 +0000 to 2019-01-20 22:31:07 +0000 - Put mtime-on-use behind a feature flag. (rust-lang/cargo#6573) - Fix a typo in the unstable docs (rust-lang/cargo#6569) - Perhaps you meant: foo, bar or foobar (rust-lang/cargo#6550) - Refactor: Create uninstall submodule (rust-lang/cargo#6557) - Fix spurious Windows errors with switch_features_rerun. (rust-lang/cargo#6561) - Stop building on master on Travis. (rust-lang/cargo#6562) r? @Mark-Simulacrum
Hi! Rust project is very cool, but I noticed some minor issues. In every place
did you mean: bla bla
end with the question mark, so I decided to include it here too.