From 9a4511065f87e853cd37e085ac3bcc387ba495d0 Mon Sep 17 00:00:00 2001 From: bstrie <865233+bstrie@users.noreply.github.com> Date: Thu, 6 Oct 2022 17:27:32 -0400 Subject: [PATCH] style: address clippy warnings Signed-off-by: bstrie <865233+bstrie@users.noreply.github.com> --- ciborium/src/de/mod.rs | 2 +- ciborium/src/tag.rs | 14 +++++++------- ciborium/src/value/de.rs | 6 +++--- ciborium/src/value/mod.rs | 6 +++--- ciborium/src/value/ser.rs | 14 +++++++------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ciborium/src/de/mod.rs b/ciborium/src/de/mod.rs index 53e04cb..af955b3 100644 --- a/ciborium/src/de/mod.rs +++ b/ciborium/src/de/mod.rs @@ -51,7 +51,7 @@ struct Deserializer<'b, R: Read> { recurse: usize, } -impl<'de, 'a, 'b, R: Read> Deserializer<'b, R> +impl<'a, R: Read> Deserializer<'a, R> where R::Error: core::fmt::Debug, { diff --git a/ciborium/src/tag.rs b/ciborium/src/tag.rs index bc18753..1196575 100644 --- a/ciborium/src/tag.rs +++ b/ciborium/src/tag.rs @@ -426,7 +426,7 @@ impl ser::Serializer for Serializer { } } -impl<'a> ser::SerializeSeq for Serializer { +impl ser::SerializeSeq for Serializer { type Ok = u64; type Error = Error; @@ -441,7 +441,7 @@ impl<'a> ser::SerializeSeq for Serializer { } } -impl<'a> ser::SerializeTuple for Serializer { +impl ser::SerializeTuple for Serializer { type Ok = u64; type Error = Error; @@ -456,7 +456,7 @@ impl<'a> ser::SerializeTuple for Serializer { } } -impl<'a> ser::SerializeTupleStruct for Serializer { +impl ser::SerializeTupleStruct for Serializer { type Ok = u64; type Error = Error; @@ -471,7 +471,7 @@ impl<'a> ser::SerializeTupleStruct for Serializer { } } -impl<'a> ser::SerializeTupleVariant for Serializer { +impl ser::SerializeTupleVariant for Serializer { type Ok = u64; type Error = Error; @@ -486,7 +486,7 @@ impl<'a> ser::SerializeTupleVariant for Serializer { } } -impl<'a> ser::SerializeMap for Serializer { +impl ser::SerializeMap for Serializer { type Ok = u64; type Error = Error; @@ -506,7 +506,7 @@ impl<'a> ser::SerializeMap for Serializer { } } -impl<'a> ser::SerializeStruct for Serializer { +impl ser::SerializeStruct for Serializer { type Ok = u64; type Error = Error; @@ -525,7 +525,7 @@ impl<'a> ser::SerializeStruct for Serializer { } } -impl<'a> ser::SerializeStructVariant for Serializer { +impl ser::SerializeStructVariant for Serializer { type Ok = u64; type Error = Error; diff --git a/ciborium/src/value/de.rs b/ciborium/src/value/de.rs index 0d30a86..6323190 100644 --- a/ciborium/src/value/de.rs +++ b/ciborium/src/value/de.rs @@ -173,7 +173,7 @@ impl<'de> de::Deserialize<'de> for Value { struct Deserializer(T); -impl<'a, 'de> Deserializer<&'a Value> { +impl<'a> Deserializer<&'a Value> { fn integer(&self, kind: &'static str) -> Result where N: TryFrom, @@ -233,7 +233,7 @@ impl<'a, 'de> de::Deserializer<'de> for Deserializer<&'a Value> { Value::Null => visitor.visit_none(), Value::Tag(t, v) => { - let parent: Deserializer<&Value> = Deserializer(&*v); + let parent: Deserializer<&Value> = Deserializer(v); let access = crate::tag::TagAccess::new(parent, Some(*t)); visitor.visit_enum(access) } @@ -487,7 +487,7 @@ impl<'a, 'de> de::Deserializer<'de> for Deserializer<&'a Value> { v => (None, v), }; - let parent: Deserializer<&Value> = Deserializer(&*val); + let parent: Deserializer<&Value> = Deserializer(val); let access = crate::tag::TagAccess::new(parent, tag); return visitor.visit_enum(access); } diff --git a/ciborium/src/value/mod.rs b/ciborium/src/value/mod.rs index 55b6d30..7233026 100644 --- a/ciborium/src/value/mod.rs +++ b/ciborium/src/value/mod.rs @@ -452,7 +452,7 @@ impl Value { /// ``` pub fn as_array(&self) -> Option<&Vec> { match *self { - Value::Array(ref array) => Some(&*array), + Value::Array(ref array) => Some(array), _ => None, } } @@ -646,7 +646,7 @@ impl From for Value { } let mut bytes = &value.to_be_bytes()[..]; - while let Some(0) = bytes.get(0) { + while let Some(0) = bytes.first() { bytes = &bytes[1..]; } @@ -667,7 +667,7 @@ impl From for Value { }; let mut bytes = &raw.to_be_bytes()[..]; - while let Some(0) = bytes.get(0) { + while let Some(0) = bytes.first() { bytes = &bytes[1..]; } diff --git a/ciborium/src/value/ser.rs b/ciborium/src/value/ser.rs index 6c739d3..a399719 100644 --- a/ciborium/src/value/ser.rs +++ b/ciborium/src/value/ser.rs @@ -270,7 +270,7 @@ impl ser::Serializer for Serializer<()> { } } -impl<'a> ser::SerializeSeq for Serializer> { +impl ser::SerializeSeq for Serializer> { type Ok = Value; type Error = Error; @@ -286,7 +286,7 @@ impl<'a> ser::SerializeSeq for Serializer> { } } -impl<'a> ser::SerializeTuple for Serializer> { +impl ser::SerializeTuple for Serializer> { type Ok = Value; type Error = Error; @@ -302,7 +302,7 @@ impl<'a> ser::SerializeTuple for Serializer> { } } -impl<'a> ser::SerializeTupleStruct for Serializer> { +impl ser::SerializeTupleStruct for Serializer> { type Ok = Value; type Error = Error; @@ -318,7 +318,7 @@ impl<'a> ser::SerializeTupleStruct for Serializer> { } } -impl<'a> ser::SerializeTupleVariant for Serializer>> { +impl ser::SerializeTupleVariant for Serializer>> { type Ok = Value; type Error = Error; @@ -356,7 +356,7 @@ impl<'a> ser::SerializeTupleVariant for Serializer>> { } } -impl<'a> ser::SerializeMap for Serializer { +impl ser::SerializeMap for Serializer { type Ok = Value; type Error = Error; @@ -381,7 +381,7 @@ impl<'a> ser::SerializeMap for Serializer { } } -impl<'a> ser::SerializeStruct for Serializer> { +impl ser::SerializeStruct for Serializer> { type Ok = Value; type Error = Error; @@ -403,7 +403,7 @@ impl<'a> ser::SerializeStruct for Serializer> { } } -impl<'a> ser::SerializeStructVariant for Serializer>> { +impl ser::SerializeStructVariant for Serializer>> { type Ok = Value; type Error = Error;