Closed spenserblack closed 11 months ago
A string can be converted to a Box<dyn Error>, allowing something like
Box<dyn Error>
fn main() -> Result<(), Box<dyn Error>> { Err("ERROR")? }
This PR also allows type conversion from ColoredString to Box<dyn Error>, so you can do
ColoredString
fn main() -> Result<(), Box<dyn Error>> { Err("ERROR".red())? }
And get the expected styling in the error message (see added example).
A string can be converted to a
Box<dyn Error>
, allowing something likeThis PR also allows type conversion from
ColoredString
toBox<dyn Error>
, so you can doAnd get the expected styling in the error message (see added example).