From 1df96238913beae89abffa88fb12545f2f95e4d1 Mon Sep 17 00:00:00 2001 From: Eric Devolder Date: Wed, 28 Aug 2024 13:31:31 +0200 Subject: [PATCH] fixing formatting issues reported by fmt Signed-off-by: Eric Devolder --- cryptoki/src/session/object_management.rs | 6 +++++- cryptoki/tests/basic.rs | 13 +++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cryptoki/src/session/object_management.rs b/cryptoki/src/session/object_management.rs index 09ee9ea..782d42c 100644 --- a/cryptoki/src/session/object_management.rs +++ b/cryptoki/src/session/object_management.rs @@ -108,7 +108,11 @@ impl Session { /// /// This function will return a new [ObjectHandle] that references the newly created object. /// - pub fn copy_object(&self, object: ObjectHandle, template: &[Attribute]) -> Result { + pub fn copy_object( + &self, + object: ObjectHandle, + template: &[Attribute], + ) -> Result { let mut template: Vec = template.iter().map(|attr| attr.into()).collect(); let mut object_handle = 0; diff --git a/cryptoki/tests/basic.rs b/cryptoki/tests/basic.rs index 2a45e71..2a3233b 100644 --- a/cryptoki/tests/basic.rs +++ b/cryptoki/tests/basic.rs @@ -853,13 +853,9 @@ fn session_copy_object() -> TestResult { Attribute::Label("original".as_bytes().to_vec()), ]; - let copy_template = vec![ - Attribute::Label("copy".as_bytes().to_vec()), - ]; + let copy_template = vec![Attribute::Label("copy".as_bytes().to_vec())]; - let insecure_copy_template = vec![ - Attribute::Extractable(true), - ]; + let insecure_copy_template = vec![Attribute::Extractable(true)]; let (pkcs11, slot) = init_pins(); @@ -881,7 +877,9 @@ fn session_copy_object() -> TestResult { rw_session.destroy_object(copy)?; // try the copy with the insecure template. It should fail. Returning CKR_OK is considered a failure. - rw_session.copy_object(object, &insecure_copy_template).unwrap_err(); + rw_session + .copy_object(object, &insecure_copy_template) + .unwrap_err(); // delete keys rw_session.destroy_object(object)?; @@ -890,7 +888,6 @@ fn session_copy_object() -> TestResult { Ok(()) } - #[test] #[serial] fn aes_cbc_encrypt() -> TestResult {