Skip to content

Generate From impls #2

@dtolnay

Description

@dtolnay

Error types commonly provide From impls so that they can be constructed by ?.

I don't want to become a fully general From derive, but I would be okay with providing a convenient From impl just for sources. Any From impl other than from the source should be handwritten for visibility or using something like derive_more.

#[derive(Error, Debug)]
enum EnumError {
    Example(#[from] io::Error),
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions