Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

impl Fail for NoneError? #59

Closed
Closed
@Celti

Description

@Celti

Using the currently (but probably not for very much longer) unstable Try trait, one can use the question mark operator on Option<T> types, coercing them into a Result<T, NoneError>. Unfortunately, NoneError does not impl std::error::Error, meaning the Fail is not implemented for NoneError (and it being an external type, we can't implement it in our own crates).

I think this would be particularly useful in light of the pattern described in “Using the Error type” — throwing a NoneError fits right into the kind of rapid prototyping, "just show the user the error and exit" limited error handling that that exemplifies.

Would a PR with this change go amiss?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions