Skip to content

Commit

Permalink
Remove unnecessary qualifications
Browse files Browse the repository at this point in the history
  • Loading branch information
bluk committed Apr 1, 2022
1 parent 2bcd59e commit df7c07a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
rust_2018_idioms
rust_2018_idioms,
unused_lifetimes,
unused_qualifications
)]

#[cfg(all(feature = "alloc", not(feature = "std")))]
Expand Down
6 changes: 3 additions & 3 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,15 +516,15 @@ impl<'a> ser::Serializer for &'a mut MapKeySerializer {
Err(Error::UnsupportedType)
}

fn serialize_newtype_struct<T: ?Sized + ser::Serialize>(
fn serialize_newtype_struct<T: ?Sized + Serialize>(
self,
_name: &'static str,
_value: &T,
) -> Result<Vec<u8>> {
Err(Error::UnsupportedType)
}

fn serialize_newtype_variant<T: ?Sized + ser::Serialize>(
fn serialize_newtype_variant<T: ?Sized + Serialize>(
self,
_name: &'static str,
_variant_index: u32,
Expand All @@ -538,7 +538,7 @@ impl<'a> ser::Serializer for &'a mut MapKeySerializer {
Err(Error::UnsupportedType)
}

fn serialize_some<T: ?Sized + ser::Serialize>(self, _value: &T) -> Result<Vec<u8>> {
fn serialize_some<T: ?Sized + Serialize>(self, _value: &T) -> Result<Vec<u8>> {
Err(Error::UnsupportedType)
}

Expand Down
8 changes: 4 additions & 4 deletions src/value/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use super::{Number, Value};
use crate::error::Error;
use serde::de::{
self, DeserializeOwned, DeserializeSeed, IntoDeserializer, MapAccess, SeqAccess, Visitor,
DeserializeOwned, DeserializeSeed, IntoDeserializer, MapAccess, SeqAccess, Visitor,
};
use serde::forward_to_deserialize_any;
use serde_bytes::ByteBuf;
Expand Down Expand Up @@ -97,14 +97,14 @@ impl<'de> serde::Deserializer<'de> for Value {
visitor: V,
) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de>,
V: Visitor<'de>,
{
visitor.visit_newtype_struct(self)
}

fn deserialize_tuple<V>(self, _len: usize, visitor: V) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de>,
V: Visitor<'de>,
{
self.deserialize_seq(visitor)
}
Expand All @@ -116,7 +116,7 @@ impl<'de> serde::Deserializer<'de> for Value {
visitor: V,
) -> Result<V::Value, Self::Error>
where
V: de::Visitor<'de>,
V: Visitor<'de>,
{
self.deserialize_seq(visitor)
}
Expand Down
24 changes: 11 additions & 13 deletions src/value/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,15 @@ impl ser::Serializer for &mut DictKeySerializer {
Err(Error::UnsupportedType)
}

fn serialize_newtype_struct<T: ?Sized + ser::Serialize>(
fn serialize_newtype_struct<T: ?Sized + Serialize>(
self,
_name: &'static str,
_value: &T,
) -> Result<Self::Ok> {
Err(Error::UnsupportedType)
}

fn serialize_newtype_variant<T: ?Sized + ser::Serialize>(
fn serialize_newtype_variant<T: ?Sized + Serialize>(
self,
_name: &'static str,
_variant_index: u32,
Expand All @@ -422,7 +422,7 @@ impl ser::Serializer for &mut DictKeySerializer {
Err(Error::UnsupportedType)
}

fn serialize_some<T: ?Sized + ser::Serialize>(self, _value: &T) -> Result<Self::Ok> {
fn serialize_some<T: ?Sized + Serialize>(self, _value: &T) -> Result<Self::Ok> {
Err(Error::UnsupportedType)
}

Expand Down Expand Up @@ -637,7 +637,7 @@ mod tests {
use serde::Serializer;

assert!(matches!(
super::Serializer.serialize_unit_struct("Nothing"),
Serializer.serialize_unit_struct("Nothing"),
Err(Error::UnsupportedType)
));
}
Expand All @@ -647,7 +647,7 @@ mod tests {
use serde::Serializer;

assert!(matches!(
super::Serializer.serialize_unit_variant("Nothing", 0, "Case"),
Serializer.serialize_unit_variant("Nothing", 0, "Case"),
Err(Error::UnsupportedType)
));
}
Expand All @@ -656,17 +656,15 @@ mod tests {
fn test_serialize_newtype_struct() {
use serde::Serializer;

assert!(super::Serializer
.serialize_newtype_struct("Nothing", &2)
.is_ok());
assert!(Serializer.serialize_newtype_struct("Nothing", &2).is_ok());
}

#[test]
fn test_serialize_newtype_variant() {
use serde::Serializer;

assert!(matches!(
super::Serializer.serialize_unit_variant("Nothing", 0, "Case"),
Serializer.serialize_unit_variant("Nothing", 0, "Case"),
Err(Error::UnsupportedType)
));
}
Expand Down Expand Up @@ -695,7 +693,7 @@ mod tests {
use serde::Serializer;

assert!(matches!(
super::Serializer.serialize_tuple(0),
Serializer.serialize_tuple(0),
Err(Error::UnsupportedType)
));
}
Expand All @@ -705,7 +703,7 @@ mod tests {
use serde::Serializer;

assert!(matches!(
super::Serializer.serialize_tuple_struct("Tuple Struct", 2),
Serializer.serialize_tuple_struct("Tuple Struct", 2),
Err(Error::UnsupportedType)
));
}
Expand All @@ -715,7 +713,7 @@ mod tests {
use serde::Serializer;

assert!(matches!(
super::Serializer.serialize_tuple_variant("Tuple Variant", 2, "Case", 1),
Serializer.serialize_tuple_variant("Tuple Variant", 2, "Case", 1),
Err(Error::UnsupportedType)
));
}
Expand All @@ -725,7 +723,7 @@ mod tests {
use serde::Serializer;

assert!(matches!(
super::Serializer.serialize_struct_variant("Struct Variant", 2, "Case", 1),
Serializer.serialize_struct_variant("Struct Variant", 2, "Case", 1),
Err(Error::UnsupportedType)
));
}
Expand Down

0 comments on commit df7c07a

Please sign in to comment.