Skip to content

Commit

Permalink
0.8.13
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaSd committed Jul 14, 2020
1 parent 00cab34 commit f2c1d45
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 128 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
134 changes: 37 additions & 97 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "irust"
version = "0.8.12"
version = "0.8.13"
authors = ["Nbiba Bedis <[email protected]>"]
edition = "2018"
readme = "README.md"
Expand All @@ -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"
2 changes: 1 addition & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> = env::args().skip(1).collect();
Expand Down
29 changes: 2 additions & 27 deletions src/irust/highlight/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Theme, IRustError> {
let theme_file = dirs_next::config_dir()
Expand Down Expand Up @@ -81,32 +82,6 @@ pub fn theme_color_to_term_color(color: &str) -> Option<Color> {
};
parse()
} else {
// try color as name
try_from(color).ok()
}
}

// To be Removed
fn try_from(src: &str) -> Result<Color, IRustError> {
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()
}
}

0 comments on commit f2c1d45

Please sign in to comment.