Use unused results

This commit is contained in:
Matthias Beyer 2016-04-16 22:39:40 +02:00
parent 909a1431f6
commit 5300b09d79
3 changed files with 13 additions and 7 deletions

View file

@ -17,7 +17,7 @@ type Result<T> = RResult<T, CounterError>;
pub fn interactive(rt: &Runtime) {
let scmd = rt.cli().subcommand_matches("interactive");
if scmd.is_none() {
write!(stderr(), "No subcommand");
debug!("No subcommand");
exit(1);
}
let scmd = scmd.unwrap();
@ -36,7 +36,7 @@ pub fn interactive(rt: &Runtime) {
pairs.insert('q', Binding::Function(String::from("quit"), Box::new(quit)));
}
stderr().flush();
stderr().flush().ok();
loop {
println!("---");
for (k, v) in &pairs {
@ -58,10 +58,14 @@ pub fn interactive(rt: &Runtime) {
Some(&mut Binding::Counter(ref mut ctr)) => {
if increment {
debug!("Incrementing");
ctr.inc();
if let Err(e) = ctr.inc() {
trace_error(&e);
}
} else {
debug!("Decrementing");
ctr.dec();
if let Err(e) = ctr.dec() {
trace_error(&e);
}
}
true
},
@ -127,7 +131,7 @@ impl<'a> Display for Binding<'a> {
fn compute_pair<'a>(rt: &'a Runtime, spec: &str) -> Result<(char, Binding<'a>)> {
let kv = String::from(spec).into_kv();
if kv.is_none() {
write!(stderr(), "Key-Value parsing failed!");
debug!("Key-Value parsing failed!");
exit(1);
}
let kv = kv.unwrap();

View file

@ -25,7 +25,8 @@ pub fn list(rt: &Runtime) {
}
}
})
.map_err(|e| trace_error(&e));
.map_err(|e| trace_error(&e))
.ok();
}
})
.map_err(|e| trace_error(&e))

View file

@ -118,7 +118,8 @@ fn main() {
})
},
}
.map_err(|e| trace_error(&e));
.map_err(|e| trace_error(&e))
.ok();
},
|name| {
debug!("Call: {}", name);