Skip to content

Common prefix #412

Description

@jbirnick

Let's say I want to have a common prefix to all my errors, like:

#[derive(Error)]
enum MatrixParseError {
    #[error("Couldn't parse matrix: foo")]
    Foo
    #[error("Couldn't parse matrix: bar")]
    Bar
}

It would be cool to have the ability to specify such a prefix. (E.g. as [error("Couldn't parse matrix: {}")] on the enum.)

Do you think you could add that? Or do you recommend another idiomatic way of achieving this behavior?

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