From cb9ec2cdca7fe8d49a54d254bb590d23cf84229f Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Tue, 24 Sep 2019 22:15:43 -0400 Subject: [PATCH] Bump up version of crossterm, fix some bugs. --- Cargo.toml | 6 ++++-- src/utils/error.rs | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index de75153e..e25596bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ readme = "README.md" [dependencies] chrono = "0.4.9" clap = "2.33.0" -crossterm = "0.10.2" +crossterm = "0.11.0" failure = "0.1.5" futures-preview = "0.3.0-alpha.18" fern = "0.5" @@ -28,7 +28,9 @@ sysinfo = "0.9.4" tokio = "0.2.0-alpha.4" [dependencies.tui-temp-fork] -version = "0.6.2" +#git = "https://github.com/ClementTsang/tui-rs" +#path = "../tui-rs" +version = "0.6.4" default-features = false features = ['crossterm'] diff --git a/src/utils/error.rs b/src/utils/error.rs index 32df1fbf..eecda2d5 100644 --- a/src/utils/error.rs +++ b/src/utils/error.rs @@ -22,6 +22,11 @@ pub enum RustopError { /// The data provided is the error found. #[fail(display = "ERROR: Invalid error during data collection due to Heim: {}", message)] InvalidHeim { message : String }, + /// An error when the Crossterm library encounters a problem. + /// + /// The data provided is the error found. + #[fail(display = "ERROR: Invalid error due to Crossterm: {}", message)] + CrosstermError { message : String }, } impl From for RustopError { @@ -36,6 +41,12 @@ impl From for RustopError { } } +impl From for RustopError { + fn from(err : crossterm::ErrorKind) -> Self { + RustopError::CrosstermError { message : err.to_string() } + } +} + impl From for RustopError { fn from(err : std::num::ParseIntError) -> Self { RustopError::InvalidArg { message : err.to_string() }