Skip to content

Inconsistent function names in core::result #2244

Closed
@Dretch

Description

@Dretch
Contributor

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.

Activity

brson

brson commented on Jun 23, 2012

@brson
Contributor

Fixed by 2f060eb

added 2 commits that reference this issue on Sep 22, 2022

Auto merge of rust-lang#2244 - dtolnay-contrib:rustfmt0, r=RalfJung

Auto merge of rust-lang#2246 - dtolnay-contrib:rustfmt1, r=oli-obk

added a commit that references this issue on Feb 11, 2025

Merge pull request rust-lang#2244 from rust-lang/rustc-pull

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @brson@Dretch

        Issue actions

          Inconsistent function names in core::result · Issue #2244 · rust-lang/rust