Skip to content

Commit

Permalink
style: address clippy warnings
Browse files Browse the repository at this point in the history
Signed-off-by: bstrie <[email protected]>
  • Loading branch information
bstrie authored and enarxbot committed Oct 6, 2022
1 parent 109c371 commit 9a45110
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion ciborium/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{
Expand Down
14 changes: 7 additions & 7 deletions ciborium/src/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions ciborium/src/value/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl<'de> de::Deserialize<'de> for Value {

struct Deserializer<T>(T);

impl<'a, 'de> Deserializer<&'a Value> {
impl<'a> Deserializer<&'a Value> {
fn integer<N>(&self, kind: &'static str) -> Result<N, Error>
where
N: TryFrom<u128>,
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions ciborium/src/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ impl Value {
/// ```
pub fn as_array(&self) -> Option<&Vec<Value>> {
match *self {
Value::Array(ref array) => Some(&*array),
Value::Array(ref array) => Some(array),
_ => None,
}
}
Expand Down Expand Up @@ -646,7 +646,7 @@ impl From<u128> 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..];
}

Expand All @@ -667,7 +667,7 @@ impl From<i128> 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..];
}

Expand Down
14 changes: 7 additions & 7 deletions ciborium/src/value/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ impl ser::Serializer for Serializer<()> {
}
}

impl<'a> ser::SerializeSeq for Serializer<Vec<Value>> {
impl ser::SerializeSeq for Serializer<Vec<Value>> {
type Ok = Value;
type Error = Error;

Expand All @@ -286,7 +286,7 @@ impl<'a> ser::SerializeSeq for Serializer<Vec<Value>> {
}
}

impl<'a> ser::SerializeTuple for Serializer<Vec<Value>> {
impl ser::SerializeTuple for Serializer<Vec<Value>> {
type Ok = Value;
type Error = Error;

Expand All @@ -302,7 +302,7 @@ impl<'a> ser::SerializeTuple for Serializer<Vec<Value>> {
}
}

impl<'a> ser::SerializeTupleStruct for Serializer<Vec<Value>> {
impl ser::SerializeTupleStruct for Serializer<Vec<Value>> {
type Ok = Value;
type Error = Error;

Expand All @@ -318,7 +318,7 @@ impl<'a> ser::SerializeTupleStruct for Serializer<Vec<Value>> {
}
}

impl<'a> ser::SerializeTupleVariant for Serializer<Named<Vec<Value>>> {
impl ser::SerializeTupleVariant for Serializer<Named<Vec<Value>>> {
type Ok = Value;
type Error = Error;

Expand Down Expand Up @@ -356,7 +356,7 @@ impl<'a> ser::SerializeTupleVariant for Serializer<Named<Vec<Value>>> {
}
}

impl<'a> ser::SerializeMap for Serializer<Map> {
impl ser::SerializeMap for Serializer<Map> {
type Ok = Value;
type Error = Error;

Expand All @@ -381,7 +381,7 @@ impl<'a> ser::SerializeMap for Serializer<Map> {
}
}

impl<'a> ser::SerializeStruct for Serializer<Vec<(Value, Value)>> {
impl ser::SerializeStruct for Serializer<Vec<(Value, Value)>> {
type Ok = Value;
type Error = Error;

Expand All @@ -403,7 +403,7 @@ impl<'a> ser::SerializeStruct for Serializer<Vec<(Value, Value)>> {
}
}

impl<'a> ser::SerializeStructVariant for Serializer<Named<Vec<(Value, Value)>>> {
impl ser::SerializeStructVariant for Serializer<Named<Vec<(Value, Value)>>> {
type Ok = Value;
type Error = Error;

Expand Down

0 comments on commit 9a45110

Please sign in to comment.