Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

add assignment for converting errors with From<T> and Into<T> #161

@miguelraz

Description

@miguelraz

and using the ? to get the neat UX

cc @listochkin , who we were talking about this

  • buildup to the thiserror crate usage:
#[derive(Debug, thiserror::Error)]
pub enum ParseError {
    #[error("Not enough operands")]
    NotEnoughOperands,
    #[error("Not a number {0}")]
    NotANumber(String),
}

#[derive(Debug, thiserror::Error)]
pub enum CalcError {
    #[error("{0}")]
    ParseError(#[from] ParseError),
    #[error("{0}")]
    EvalError(#[from] EvalError),
}
  • show the IDE "expand macro recursively" and "implement all fields"

Metadata

Metadata

Assignees

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