Skip to content
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

Inconsistent function names in core::result #2244

Closed
Dretch opened this issue Apr 19, 2012 · 1 comment
Closed

Inconsistent function names in core::result #2244

Dretch opened this issue Apr 19, 2012 · 1 comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Milestone

Comments

@Dretch
Copy link
Contributor

Dretch commented Apr 19, 2012

The is_success and is_failure functions/methods in core::result should be called is_ok and is_err instead, so that they correlate with the enum's tag names. These functions were originally called success / failure presumably to avoid clashing with the enum's tags (i.e. the functions could not be called ok / err), but now that they are prefixed with is_ then these additional names are not required.

An independent issue is that the documentation for is_failure (perhaps becoming is_err) should say "Returns true if the result is err" rather than "Returns true if the result is error" - because the enum tag is called err not error.

@brson
Copy link
Contributor

brson commented Jun 23, 2012

Fixed by 2f060eb

@brson brson closed this as completed Jun 23, 2012
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
Format tests and benches with rustfmt (1-50 of 300)

Extracted from rust-lang#2097.

I filtered this PR to contain exclusively "easy" cases to start off with, i.e. where there is no compiletest_rs (or other) comment in the vicinity that might need to get manually repositioned.
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
Format tests with rustfmt (51-100 of 300)

Extracted from rust-lang#2097.

Like rust-lang#2244, this is intended to be "easy" cases which don't involve comments in the vicinity.
BoxyUwU pushed a commit to BoxyUwU/rust that referenced this issue Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

2 participants