From e748c0ea60062ab0db1af991461a3ee366568e04 Mon Sep 17 00:00:00 2001 From: Zeke Mostov Date: Mon, 10 Oct 2022 14:09:58 -0400 Subject: [PATCH] Clippy pass 1 --- nsm-lib/src/lib.rs | 3 +-- nsm-test/src/bin/nsm-check.rs | 2 +- src/api/mod.rs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nsm-lib/src/lib.rs b/nsm-lib/src/lib.rs index 101ca39..306b6f3 100644 --- a/nsm-lib/src/lib.rs +++ b/nsm-lib/src/lib.rs @@ -197,8 +197,7 @@ pub extern "C" fn nsm_get_description(fd: i32, nsm_description: &mut NsmDescript /// *Argument 2 (input)*: Size of the user data buffer. /// *Returns*: The optional byte buffer. unsafe fn get_byte_buf_from_user_data(data: *const u8, len: u32) -> Option> { - let data_vec = nsm_get_vec_from_raw(data, len); - data_vec + nsm_get_vec_from_raw(data, len) } /// NSM `GetAttestationDoc` operation for non-Rust callers. diff --git a/nsm-test/src/bin/nsm-check.rs b/nsm-test/src/bin/nsm-check.rs index 6a9a664..b8cad8c 100644 --- a/nsm-test/src/bin/nsm-check.rs +++ b/nsm-test/src/bin/nsm-check.rs @@ -389,7 +389,7 @@ fn check_attestation(ctx: i32) { ctx, Some(dummy_data.clone()), Some(dummy_data.clone()), - Some(dummy_data.clone()), + Some(dummy_data), ); println!( "Checked Request::Attestation with user data, nonce and public key ({} bytes each).", diff --git a/src/api/mod.rs b/src/api/mod.rs index 52773bd..7e083fc 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -267,7 +267,7 @@ impl AttestationDoc { certificate, user_data, nonce, - public_key: public_key, + public_key, } }