Skip to content

Commit

Permalink
Fix trivial numeric cast lint
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Persson <[email protected]>
  • Loading branch information
larper2axis committed Sep 4, 2024
1 parent 3df67b4 commit 283c1bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cryptoki/src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ pub enum UserType {
}

impl From<UserType> for CK_USER_TYPE {
// Mask lint for n.into() on 32-bit systems.
#![allow(clippy::useless_conversion)]
fn from(user_type: UserType) -> CK_USER_TYPE {
match user_type {
UserType::So => CKU_SO,
UserType::User => CKU_USER,
UserType::ContextSpecific => CKU_CONTEXT_SPECIFIC,
UserType::VendorExtension(n) => n as CK_USER_TYPE,
UserType::VendorExtension(n) => n.into(),
}
}
}

0 comments on commit 283c1bb

Please sign in to comment.