summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClementTsang <clementjhtsang@gmail.com>2019-09-24 22:15:43 -0400
committerClementTsang <clementjhtsang@gmail.com>2019-09-24 22:15:43 -0400
commitcb9ec2cdca7fe8d49a54d254bb590d23cf84229f (patch)
treed302246fc4df3236386cfe481d7d3c7d2977fad5
parentf96d82ccb7aa4c1c73f5b44835f3568bd5dd80d6 (diff)
Bump up version of crossterm, fix some bugs.
-rw-r--r--Cargo.toml6
-rw-r--r--src/utils/error.rs11
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<std::io::Error> for RustopError {
@@ -36,6 +41,12 @@ impl From<heim::Error> for RustopError {
}
}
+impl From<crossterm::ErrorKind> for RustopError {
+ fn from(err : crossterm::ErrorKind) -> Self {
+ RustopError::CrosstermError { message : err.to_string() }
+ }
+}
+
impl From<std::num::ParseIntError> for RustopError {
fn from(err : std::num::ParseIntError) -> Self {
RustopError::InvalidArg { message : err.to_string() }