-
Notifications
You must be signed in to change notification settings - Fork 259
Open
Description
Is there a reason that cursive::theme::Error doesn't implement the standard Error trait? I would like to write
fn load_theme(siv: &mut CursiveRunnable, path: PathBuf) -> anyhow::Result<()> {
siv.load_theme_file(path)?;
Ok(())
}However, currently one has to write the following:
fn load_theme(siv: &mut CursiveRunnable, path: PathBuf) -> anyhow::Result<()> {
match siv.load_theme_file(path) {
Ok(_) => Ok(()),
Err(e) => match e {
cursive::theme::Error::Io(e) => Err(e.into()),
cursive::theme::Error::Parse(e) => Err(e.into()),
}
}
}I would be happy to open a PR for this if needed. Thank you!
Metadata
Metadata
Assignees
Labels
No labels