Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks
miguelraz opened this issue Sep 26, 2022 · 0 comments
Open
2 tasks

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

miguelraz opened this issue Sep 26, 2022 · 0 comments
Assignees

Comments

@miguelraz
Copy link
Contributor

miguelraz commented Sep 26, 2022

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"
@miguelraz miguelraz self-assigned this Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant