Add impl Borror<Cursive> for CursiveRunnable

This commit is contained in:
Alexandre Bury 2021-01-19 10:40:07 -08:00
parent 5becb0110a
commit 73453b2097
2 changed files with 13 additions and 1 deletions

View File

@ -8,7 +8,7 @@ license = "MIT"
name = "cursive" name = "cursive"
readme = "../Readme.md" readme = "../Readme.md"
repository = "https://github.com/gyscos/cursive" repository = "https://github.com/gyscos/cursive"
version = "0.16.2" version = "0.16.3"
edition = "2018" edition = "2018"
[package.metadata.docs.rs] [package.metadata.docs.rs]

View File

@ -33,6 +33,18 @@ impl std::ops::DerefMut for CursiveRunnable {
} }
} }
impl std::borrow::Borrow<Cursive> for CursiveRunnable {
fn borrow(&self) -> &Cursive {
&*self
}
}
impl std::borrow::BorrowMut<Cursive> for CursiveRunnable {
fn borrow_mut(&mut self) -> &mut Cursive {
&mut *self
}
}
fn boxed(e: impl std::error::Error + 'static) -> Box<dyn std::error::Error> { fn boxed(e: impl std::error::Error + 'static) -> Box<dyn std::error::Error> {
Box::new(e) Box::new(e)
} }