Skip to content

Commit

Permalink
Fix new Clippy warning and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
sbihel committed Jun 20, 2024
1 parent 4e7449b commit d3ab55e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "r2d2-cryptoki"
version = "0.2.1"
version = "0.3.0"
edition = "2021"
authors = ["Spruce Systems, Inc."]
license = "MIT OR Apache-2.0"
Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ impl SessionManager {
}
};
let res = match limit {
Limit::Max(m) => Some(m.try_into().unwrap_or(u32::max_value())),
Limit::Max(m) => Some(m.try_into().unwrap_or(u32::MAX)),
Limit::Unavailable => None,
Limit::Infinite => Some(u32::max_value()),
Limit::Infinite => Some(u32::MAX),
};
Ok(if let Some(true) = res.map(|r| r > maximum) {
Some(maximum)
Expand Down Expand Up @@ -147,7 +147,10 @@ impl ManageConnection for SessionManager {
let actual_state = session.get_session_info()?.session_state();
let expected_state = &self.session_type;
if actual_state != expected_state.as_state() {
Err(Self::Error::Pkcs11(RvError::UserNotLoggedIn, Function::GetSessionInfo))
Err(Self::Error::Pkcs11(
RvError::UserNotLoggedIn,
Function::GetSessionInfo,
))
} else {
Ok(())
}
Expand Down

0 comments on commit d3ab55e

Please sign in to comment.