Skip to content

Commit

Permalink
Satisfy clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Oct 4, 2024
1 parent 9348d97 commit 7d29212
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions aws-lc-fips-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Modifications copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC

#![allow(clippy::ref_option)]
// Clippy can only be run on nightly toolchain
#![cfg_attr(clippy, feature(custom_inner_attributes))]
#![cfg_attr(clippy, clippy::msrv = "1.77")]
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-rs/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use zeroize::Zeroize;
/// The buffer will be zeroed on drop if it is owned.
pub struct Buffer<'a, T>(Cow<'a, [u8]>, PhantomData<T>);

impl<'a, T> Drop for Buffer<'a, T> {
impl<T> Drop for Buffer<'_, T> {
fn drop(&mut self) {
if let Cow::Owned(b) = &mut self.0 {
b.zeroize();
Expand Down
4 changes: 2 additions & 2 deletions aws-lc-rs/src/hkdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ pub struct Okm<'a, L: KeyType> {
len: L,
}

impl<'a, L: KeyType> fmt::Debug for Okm<'a, L> {
impl<L: KeyType> fmt::Debug for Okm<'_, L> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("hkdf::Okm").field("prk", &self.prk).finish()
}
}

impl<'a, L: KeyType> Drop for Okm<'a, L> {
impl<L: KeyType> Drop for Okm<'_, L> {
fn drop(&mut self) {
self.info_bytes.zeroize();
}
Expand Down
4 changes: 2 additions & 2 deletions aws-lc-rs/src/kem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,15 +465,15 @@ impl<'a> Ciphertext<'a> {
}
}

impl<'a> Drop for Ciphertext<'a> {
impl Drop for Ciphertext<'_> {
fn drop(&mut self) {
if let Cow::Owned(ref mut v) = self.0 {
v.zeroize();
}
}
}

impl<'a> AsRef<[u8]> for Ciphertext<'a> {
impl AsRef<[u8]> for Ciphertext<'_> {
fn as_ref(&self) -> &[u8] {
match self.0 {
Cow::Borrowed(v) => v,
Expand Down
1 change: 1 addition & 0 deletions aws-lc-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Modifications copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC

#![allow(clippy::ref_option)]
// Clippy can only be run on nightly toolchain
#![cfg_attr(clippy, feature(custom_inner_attributes))]
#![cfg_attr(clippy, clippy::msrv = "1.77")]
Expand Down

0 comments on commit 7d29212

Please sign in to comment.