diff --git a/src/lib.rs b/src/lib.rs index 67a5f0d..1ff5d25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -186,7 +186,7 @@ pub mod shell { let mut stdout = stdout().into_raw_mode().unwrap(); //write!(stdout, "{}", cursor::Save); - for c in current_cmd.graphemes(true) { + for _c in current_cmd.graphemes(true) { write!(stdout, "\x1b[D").unwrap(); write!(stdout, "\x1b[K").unwrap(); } diff --git a/src/shell/history.rs b/src/shell/history.rs index 8bd2fe3..fb03608 100644 --- a/src/shell/history.rs +++ b/src/shell/history.rs @@ -38,7 +38,7 @@ pub fn get_curr_history_number() -> i32 { //Returns CURRENT history number, AKA the one for the command we are typing let mynumber = match get_history_number() { Ok(n) => n + 1, - Err(e) => 1, + Err(_) => 1, }; return mynumber; @@ -81,9 +81,10 @@ pub fn get_hist_from_number(number: &i32) -> Option { .expect("Error reading a line in hist file") .parse() .unwrap(); - let c = s.next().expect("No command!"); + //let c = s.next().expect("No command!"); if &n == number { - return Some(String::from(c)); + let remainder: String = s.map(|c| c.to_string()).collect::>().join(" "); + return Some(String::from(remainder)); } } return None;