Skip to content

Commit

Permalink
adjustments required by clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Devolder <[email protected]>
  • Loading branch information
keldonin committed Sep 4, 2024
1 parent 168b57e commit 4ec0a26
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions cryptoki/src/session/object_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,26 +144,22 @@ impl<'a> Iterator for ObjectHandleIterator<'a> {
}
}

let p11rv;

match get_pkcs11_func!(self.session.client(), C_FindObjects) {
Some(f) => {
p11rv = unsafe {
f(
self.session.handle(),
self.cache.as_mut_ptr(),
self.cache.len() as CK_ULONG,
&mut self.object_count as *mut usize as CK_ULONG_PTR,
)
};
}
let p11rv = match get_pkcs11_func!(self.session.client(), C_FindObjects) {
Some(f) => unsafe {
f(
self.session.handle(),
self.cache.as_mut_ptr(),
self.cache.len() as CK_ULONG,
&mut self.object_count as *mut usize as CK_ULONG_PTR,
)
},
None => {
// C_FindObjects() is not implemented on this implementation
// sort of unexpected. TODO: Consider panic!() instead?
log::error!("C_FindObjects() is not implemented on this library");
return Some(Err(Error::NullFunctionPointer) as Result<ObjectHandle>);
}
}
};

if let Rv::Error(error) = Rv::from(p11rv) {
return Some(
Expand Down

0 comments on commit 4ec0a26

Please sign in to comment.