libimagcounter: Replace .err().unwrap() with .unwrap_err()

This commit is contained in:
Matthias Beyer 2016-04-17 21:08:05 +02:00
parent c1b4ce55b5
commit d01c2d294e

View file

@ -30,7 +30,7 @@ impl<'a> Counter<'a> {
let fle = {
let lockentry = store.create(ModuleEntryPath::new(name.clone()).into_storeid());
if lockentry.is_err() {
return Err(CE::new(CEK::StoreWriteError, Some(Box::new(lockentry.err().unwrap()))));
return Err(CE::new(CEK::StoreWriteError, Some(Box::new(lockentry.unwrap_err()))));
}
let mut lockentry = lockentry.unwrap();
@ -39,17 +39,17 @@ impl<'a> Counter<'a> {
let mut header = entry.get_header_mut();
let setres = header.set("counter", Value::Table(BTreeMap::new()));
if setres.is_err() {
return Err(CE::new(CEK::StoreWriteError, Some(Box::new(setres.err().unwrap()))));
return Err(CE::new(CEK::StoreWriteError, Some(Box::new(setres.unwrap_err()))));
}
let setres = header.set("counter.name", Value::String(name));
if setres.is_err() {
return Err(CE::new(CEK::StoreWriteError, Some(Box::new(setres.err().unwrap()))));
return Err(CE::new(CEK::StoreWriteError, Some(Box::new(setres.unwrap_err()))));
}
let setres = header.set("counter.value", Value::Integer(init));
if setres.is_err() {
return Err(CE::new(CEK::StoreWriteError, Some(Box::new(setres.err().unwrap()))));
return Err(CE::new(CEK::StoreWriteError, Some(Box::new(setres.unwrap_err()))));
}
}