#rustlang has 'thiserror' that makes Typed Stack Traces a bliss.
For ex:
// after putting [from]
enum Function2Error{
Function1Error(#[from] Function1Error)
}
// then we can replace this line
let res = function1().map_err(Function2Error::Function1Error)
// with this line
let res = function1()?
For ex:
// after putting [from]
enum Function2Error{
Function1Error(#[from] Function1Error)
}
// then we can replace this line
let res = function1().map_err(Function2Error::Function1Error)
// with this line
let res = function1()?
Comments