Fix checking if there have been new errors.

This commit is contained in:
Tomasz Miąsko 2016-01-28 14:29:57 +01:00
parent a891c72976
commit b3e30b5fc3

View File

@ -179,9 +179,9 @@ impl Session {
pub fn track_errors<F, T>(&self, f: F) -> Result<T, usize>
where F: FnOnce() -> T
{
let mut count = self.err_count();
let count = self.err_count();
let result = f();
count -= self.err_count();
let count = self.err_count() - count;
if count == 0 {
Ok(result)
} else {