libimagcounter: Replace .err().unwrap() with .unwrap_err()
This commit is contained in:
parent
c1b4ce55b5
commit
d01c2d294e
1 changed files with 4 additions and 4 deletions
|
@ -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()))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue