From f2c1d45f8473111fbaa37f845cc5511ea44b2498 Mon Sep 17 00:00:00 2001 From: Nbiba Bedis Date: Tue, 14 Jul 2020 21:36:27 +0100 Subject: [PATCH] 0.8.13 --- CHANGELOG.md | 4 ++ Cargo.lock | 134 ++++++++++------------------------- Cargo.toml | 6 +- src/args.rs | 2 +- src/irust/highlight/theme.rs | 29 +------- 5 files changed, 47 insertions(+), 128 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f46cc96..7c29bb31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +**0.8.13** +- Fix crash when history file is first created +- Update dependencies + **0.8.12** - Fix `rustfmt` install command - Add a reminder to reload shell after installing a dependency, fix clippy warning diff --git a/Cargo.lock b/Cargo.lock index db55a05e..7cbd96bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,9 +87,9 @@ dependencies = [ [[package]] name = "crossterm" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9851d20b9809e561297ec3ca85d7cba3a57507fe8d01d07ba7b52469e1c89a11" +checksum = "6f4919d60f26ae233e14233cc39746c8c8bb8cd7b05840ace83604917b51b6c7" dependencies = [ "bitflags", "crossterm_winapi", @@ -99,7 +99,7 @@ dependencies = [ "parking_lot", "serde", "signal-hook", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -108,7 +108,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "057b7146d02fb50175fd7dbe5158f6097f33d02831f43b4ee8ae4ddf67b68f5c" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -129,25 +129,9 @@ checksum = "9c60f7b8a8953926148223260454befb50c751d3c50e1c178c4fd1ace4083c9a" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "getrandom" version = "0.1.14" @@ -159,18 +143,9 @@ dependencies = [ "wasi", ] -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "irust" -version = "0.8.12" +version = "0.8.13" dependencies = [ "crossterm", "dirs-next", @@ -180,16 +155,6 @@ dependencies = [ "toml", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -222,44 +187,26 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.22" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +checksum = "6e9971bc8349a361217a8f2a41f5d011274686bd4436465ba51730921039d7fb" dependencies = [ - "cfg-if", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", + "lazy_static", "libc", "log", "miow", - "net2", - "slab", - "winapi 0.2.8", + "ntapi", + "winapi", ] [[package]] name = "miow" -version = "0.2.1" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "net2" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" -dependencies = [ - "cfg-if", - "libc", - "winapi 0.3.9", + "socket2", + "winapi", ] [[package]] @@ -275,6 +222,15 @@ dependencies = [ "void", ] +[[package]] +name = "ntapi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a31937dea023539c72ddae0e3571deadc1414b300483fa7aaec176168cfa9d2" +dependencies = [ + "winapi", +] + [[package]] name = "once_cell" version = "1.4.0" @@ -302,7 +258,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -399,18 +355,24 @@ dependencies = [ "libc", ] -[[package]] -name = "slab" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" - [[package]] name = "smallvec" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f" +[[package]] +name = "socket2" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "winapi", +] + [[package]] name = "syn" version = "1.0.34" @@ -449,12 +411,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -465,12 +421,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -482,13 +432,3 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] diff --git a/Cargo.toml b/Cargo.toml index dfccd9d1..dfa00693 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "irust" -version = "0.8.12" +version = "0.8.13" authors = ["Nbiba Bedis "] edition = "2018" readme = "README.md" @@ -9,11 +9,11 @@ repository = "https://github.com/sigmaSd/IRust" license = "MIT" [dependencies] -crossterm = {version = "0.17.5", features=["serde"]} +crossterm = { version = "0.17.7", features = ["serde"] } dirs-next = "1.0.1" once_cell = "1.4.0" toml = "0.5.6" -serde = {version = "1.0.114", features=["derive"]} +serde = { version = "1.0.114", features = ["derive"] } [target.'cfg(unix)'.dependencies] nix = "0.17.0" diff --git a/src/args.rs b/src/args.rs index 583e34d0..ceee6a30 100644 --- a/src/args.rs +++ b/src/args.rs @@ -3,7 +3,7 @@ use crate::irust::{options::Options, IRust}; use std::env; -const VERSION: &str = "0.8.12"; +const VERSION: &str = "0.8.13"; pub fn handle_args(irust: &mut IRust) -> Result<(), IRustError> { let args: Vec = env::args().skip(1).collect(); diff --git a/src/irust/highlight/theme.rs b/src/irust/highlight/theme.rs index 682fa689..e53646ae 100644 --- a/src/irust/highlight/theme.rs +++ b/src/irust/highlight/theme.rs @@ -2,6 +2,7 @@ use crate::irust::IRustError; use crossterm::style::Color; use serde::{Deserialize, Serialize}; use std::io::Write; +use std::convert::TryFrom; pub fn theme() -> Result { let theme_file = dirs_next::config_dir() @@ -81,32 +82,6 @@ pub fn theme_color_to_term_color(color: &str) -> Option { }; parse() } else { - // try color as name - try_from(color).ok() - } -} - -// To be Removed -fn try_from(src: &str) -> Result { - let src = src.to_lowercase(); - - match src.as_ref() { - "black" => Ok(Color::Black), - "dark_grey" => Ok(Color::DarkGrey), - "red" => Ok(Color::Red), - "dark_red" => Ok(Color::DarkRed), - "green" => Ok(Color::Green), - "dark_green" => Ok(Color::DarkGreen), - "yellow" => Ok(Color::Yellow), - "dark_yellow" => Ok(Color::DarkYellow), - "blue" => Ok(Color::Blue), - "dark_blue" => Ok(Color::DarkBlue), - "magenta" => Ok(Color::Magenta), - "dark_magenta" => Ok(Color::DarkMagenta), - "cyan" => Ok(Color::Cyan), - "dark_cyan" => Ok(Color::DarkCyan), - "white" => Ok(Color::White), - "grey" => Ok(Color::Grey), - _ => Err(IRustError::Custom("Uknown color".into())), + Color::try_from(color).ok() } }