From fa4289c9f87fb795f62cac3bf4e840dc0851cc7c Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Tue, 8 Jun 2021 17:19:16 +0200 Subject: [PATCH] address two clippy warnings --- oqs/src/macros.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oqs/src/macros.rs b/oqs/src/macros.rs index 3d89647452..215d09a66e 100644 --- a/oqs/src/macros.rs +++ b/oqs/src/macros.rs @@ -35,8 +35,8 @@ macro_rules! newtype_buffer { $name_ref { bytes } } - /// Copy this to the owned variant - pub fn to_owned(&self) -> $name { + /// Clone this into the owned variant + pub fn to_owned(self) -> $name { $name { bytes: self.bytes.to_vec(), } @@ -70,6 +70,7 @@ macro_rules! newtype_buffer { impl $name { /// Length in bytes + #[allow(clippy::len_without_is_empty)] pub fn len(&self) -> usize { self.bytes.len() }