Skip to content
Snippets Groups Projects
Commit 1d622c14 authored by Michael Gattozzi's avatar Michael Gattozzi
Browse files

Merge pull request #1 from Lacaranian/patch-1

Avoid using _unused
parents 22231418 1f657c8e
No related branches found
No related tags found
Loading
...@@ -6,16 +6,20 @@ use command::*; ...@@ -6,16 +6,20 @@ use command::*;
pub fn repl() { pub fn repl() {
let mut input = String::new(); let mut input = String::new();
let _unused = io::stdin().read_line(&mut input); match io::stdin().read_line(&mut input) {
let out_wrap = run(input.trim().split_whitespace().collect::<Vec<&str>>()); Ok(n) => {
if out_wrap.is_some() { let out_wrap = run(input.trim().split_whitespace().collect::<Vec<&str>>());
let out = out_wrap.unwrap(); if out_wrap.is_some() {
if out.stdout.is_empty() { let out = out_wrap.unwrap();
println!("{}",out.stderr.trim()); if out.stdout.is_empty() {
} else { println!("{}",out.stderr.trim());
println!("{}",out.stdout.trim()); } else {
println!("{}",out.stdout.trim());
}
} else {
println!("{} is not a valid command", input.trim());
}
} }
} else { Err(error) => println!("Line Read Error: {}", error)
println!("{} is not a valid command", input.trim()); };
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment