Update crossterm to 0.11

This commit is contained in:
Alexandre Bury 2019-10-04 13:16:48 -07:00
parent 149beee7b4
commit d6f5c0e0fa
4 changed files with 5 additions and 4 deletions

View File

@ -7,6 +7,7 @@
- `cursive::event::AnyCb` changed from `Box<...>` to `&mut ...`, so users of
`View::call_on_any` no longer need to box their closures.
- Remove `BoxView::squishable`.
- Update crossterm to 0.11
### API updates

View File

@ -74,7 +74,7 @@ version = "1.5.3"
[dependencies.crossterm]
optional = true
version = "0.10.1"
version = "0.11"
[target.'cfg(unix)'.dependencies]
signal-hook = "0.1.10"

View File

@ -30,7 +30,7 @@ pub struct Backend {
impl Backend {
/// Creates a new crossterm backend.
pub fn init() -> std::io::Result<Box<dyn backend::Backend>>
pub fn init() -> Result<Box<dyn backend::Backend>, crossterm::ErrorKind>
where
Self: Sized,
{
@ -196,7 +196,7 @@ impl backend::Backend for Backend {
}
fn screen_size(&self) -> Vec2 {
let size = self.terminal.terminal_size();
let size = self.terminal.size().unwrap_or((0, 0));
Vec2::from(size)
}

View File

@ -173,7 +173,7 @@ impl Cursive {
/// Creates a new Cursive root using a crossterm backend.
#[cfg(feature = "crossterm-backend")]
pub fn crossterm() -> std::io::Result<Self> {
pub fn crossterm() -> Result<Self, crossterm::ErrorKind> {
Self::try_new(backend::crossterm::Backend::init)
}