Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy::needless_lifetimes #789

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion serde_with/src/base64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ where
{
struct Helper<T, ALPHABET>(PhantomData<(T, ALPHABET)>);

impl<'de, T, ALPHABET> Visitor<'de> for Helper<T, ALPHABET>
impl<T, ALPHABET> Visitor<'_> for Helper<T, ALPHABET>
where
T: TryFrom<Vec<u8>>,
ALPHABET: Alphabet,
Expand Down
2 changes: 1 addition & 1 deletion serde_with/src/chrono_0_4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub mod datetime_utc_ts_seconds_from_any {
D: Deserializer<'de>,
{
struct Helper;
impl<'de> Visitor<'de> for Helper {
impl Visitor<'_> for Helper {
type Value = DateTime<Utc>;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
18 changes: 9 additions & 9 deletions serde_with/src/content/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub(crate) enum Content<'de> {
Map(Vec<(Content<'de>, Content<'de>)>),
}

impl<'de> Content<'de> {
impl Content<'_> {
#[cold]
fn unexpected(&self) -> Unexpected<'_> {
match *self {
Expand Down Expand Up @@ -1123,7 +1123,7 @@ pub struct ContentRefDeserializer<'a, 'de, E> {
err: PhantomData<E>,
}

impl<'a, 'de, E> ContentRefDeserializer<'a, 'de, E>
impl<'de, E> ContentRefDeserializer<'_, 'de, E>
where
E: DeError,
{
Expand Down Expand Up @@ -1214,7 +1214,7 @@ where

/// Used when deserializing an untagged enum because the content may need
/// to be used more than once.
impl<'de, 'a, E> Deserializer<'de> for ContentRefDeserializer<'a, 'de, E>
impl<'de, E> Deserializer<'de> for ContentRefDeserializer<'_, 'de, E>
where
E: DeError,
{
Expand Down Expand Up @@ -1631,7 +1631,7 @@ where
err: PhantomData<E>,
}

impl<'de, 'a, E> VariantAccess<'de> for VariantRefDeserializer<'a, 'de, E>
impl<'de, E> VariantAccess<'de> for VariantRefDeserializer<'_, 'de, E>
where
E: DeError,
{
Expand Down Expand Up @@ -1726,7 +1726,7 @@ where
}
}

impl<'de, 'a, E> Deserializer<'de> for SeqRefDeserializer<'a, 'de, E>
impl<'de, E> Deserializer<'de> for SeqRefDeserializer<'_, 'de, E>
where
E: DeError,
{
Expand Down Expand Up @@ -1763,7 +1763,7 @@ where
}
}

impl<'de, 'a, E> SeqAccess<'de> for SeqRefDeserializer<'a, 'de, E>
impl<'de, E> SeqAccess<'de> for SeqRefDeserializer<'_, 'de, E>
where
E: DeError,
{
Expand Down Expand Up @@ -1810,7 +1810,7 @@ where
}
}

impl<'de, 'a, E> MapAccess<'de> for MapRefDeserializer<'a, 'de, E>
impl<'de, E> MapAccess<'de> for MapRefDeserializer<'_, 'de, E>
where
E: DeError,
{
Expand Down Expand Up @@ -1847,7 +1847,7 @@ where
}
}

impl<'de, 'a, E> Deserializer<'de> for MapRefDeserializer<'a, 'de, E>
impl<'de, E> Deserializer<'de> for MapRefDeserializer<'_, 'de, E>
where
E: DeError,
{
Expand Down Expand Up @@ -1884,7 +1884,7 @@ where
}
}

impl<'de, 'a, E> IntoDeserializer<'de, E> for ContentRefDeserializer<'a, 'de, E>
impl<'de, E> IntoDeserializer<'de, E> for ContentRefDeserializer<'_, 'de, E>
where
E: DeError,
{
Expand Down
10 changes: 5 additions & 5 deletions serde_with/src/de/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ where
D: Deserializer<'de>,
{
struct Helper<S>(PhantomData<S>);
impl<'de, S> Visitor<'de> for Helper<S>
impl<S> Visitor<'_> for Helper<S>
where
S: FromStr,
<S as FromStr>::Err: Display,
Expand Down Expand Up @@ -918,7 +918,7 @@ where
D: Deserializer<'de>,
{
struct OptionStringEmptyNone<S>(PhantomData<S>);
impl<'de, S> Visitor<'de> for OptionStringEmptyNone<S>
impl<S> Visitor<'_> for OptionStringEmptyNone<S>
where
S: FromStr,
S::Err: Display,
Expand Down Expand Up @@ -1036,7 +1036,7 @@ where
{
struct Helper<SEPARATOR, I, T>(PhantomData<(SEPARATOR, I, T)>);

impl<'de, SEPARATOR, I, T> Visitor<'de> for Helper<SEPARATOR, I, T>
impl<SEPARATOR, I, T> Visitor<'_> for Helper<SEPARATOR, I, T>
where
SEPARATOR: Separator,
I: FromIterator<T>,
Expand Down Expand Up @@ -1811,7 +1811,7 @@ impl<'de> DeserializeAs<'de, bool> for BoolFromInt<Strict> {
D: Deserializer<'de>,
{
struct U8Visitor;
impl<'de> Visitor<'de> for U8Visitor {
impl Visitor<'_> for U8Visitor {
type Value = bool;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down Expand Up @@ -1910,7 +1910,7 @@ impl<'de> DeserializeAs<'de, bool> for BoolFromInt<Flexible> {
D: Deserializer<'de>,
{
struct U8Visitor;
impl<'de> Visitor<'de> for U8Visitor {
impl Visitor<'_> for U8Visitor {
type Value = bool;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
4 changes: 2 additions & 2 deletions serde_with/src/enum_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ struct SerializeVariant<'a, M> {
content: Content,
}

impl<'a, M> SerializeStructVariant for SerializeVariant<'a, M>
impl<M> SerializeStructVariant for SerializeVariant<'_, M>
where
M: SerializeMap,
{
Expand All @@ -674,7 +674,7 @@ where
}
}

impl<'a, M> SerializeTupleVariant for SerializeVariant<'a, M>
impl<M> SerializeTupleVariant for SerializeVariant<'_, M>
where
M: SerializeMap,
{
Expand Down
2 changes: 1 addition & 1 deletion serde_with/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ where
{
struct Helper<S, SAs>(PhantomData<(S, SAs)>);

impl<'de, S, SAs> Visitor<'de> for Helper<S, SAs>
impl<S, SAs> Visitor<'_> for Helper<S, SAs>
where
SAs: for<'a> DeserializeAs<'a, S>,
{
Expand Down
10 changes: 5 additions & 5 deletions serde_with/src/key_value_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ struct KeyValueSeqSerializer<'a, M> {
key: Option<SerContent>,
}

impl<'a, M> SerializeSeq for KeyValueSeqSerializer<'a, M>
impl<M> SerializeSeq for KeyValueSeqSerializer<'_, M>
where
M: SerializeMap,
{
Expand Down Expand Up @@ -712,7 +712,7 @@ struct KeyValueTupleSerializer<'a, M> {
key: Option<SerContent>,
}

impl<'a, M> SerializeTuple for KeyValueTupleSerializer<'a, M>
impl<M> SerializeTuple for KeyValueTupleSerializer<'_, M>
where
M: SerializeMap,
{
Expand Down Expand Up @@ -754,7 +754,7 @@ struct KeyValueTupleStructSerializer<'a, M> {
key: Option<SerContent>,
}

impl<'a, M> SerializeTupleStruct for KeyValueTupleStructSerializer<'a, M>
impl<M> SerializeTupleStruct for KeyValueTupleStructSerializer<'_, M>
where
M: SerializeMap,
{
Expand Down Expand Up @@ -796,7 +796,7 @@ struct KeyValueMapSerializer<'a, M> {
tmp: Option<SerContent>,
}

impl<'a, M> SerializeMap for KeyValueMapSerializer<'a, M>
impl<M> SerializeMap for KeyValueMapSerializer<'_, M>
where
M: SerializeMap,
{
Expand Down Expand Up @@ -857,7 +857,7 @@ struct KeyValueStructSerializer<'a, M> {
key: Option<SerContent>,
}

impl<'a, M> SerializeStruct for KeyValueStructSerializer<'a, M>
impl<M> SerializeStruct for KeyValueStructSerializer<'_, M>
where
M: SerializeMap,
{
Expand Down
2 changes: 1 addition & 1 deletion serde_with/src/ser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ where
}
}

impl<'a, T, U> Serialize for SerializeAsWrap<'a, T, U>
impl<T, U> Serialize for SerializeAsWrap<'_, T, U>
where
T: ?Sized,
U: ?Sized,
Expand Down
6 changes: 3 additions & 3 deletions serde_with/src/time_0_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ impl<'de> DeserializeAs<'de, OffsetDateTime> for Rfc2822 {
D: Deserializer<'de>,
{
struct Helper;
impl<'de> Visitor<'de> for Helper {
impl Visitor<'_> for Helper {
type Value = OffsetDateTime;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down Expand Up @@ -575,7 +575,7 @@ impl<'de> DeserializeAs<'de, OffsetDateTime> for Rfc3339 {
D: Deserializer<'de>,
{
struct Helper;
impl<'de> Visitor<'de> for Helper {
impl Visitor<'_> for Helper {
type Value = OffsetDateTime;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down Expand Up @@ -611,7 +611,7 @@ impl<'de, const CONFIG: EncodedConfig> DeserializeAs<'de, OffsetDateTime> for Is
D: Deserializer<'de>,
{
struct Helper<const CONFIG: EncodedConfig>;
impl<'de, const CONFIG: EncodedConfig> Visitor<'de> for Helper<CONFIG> {
impl<const CONFIG: EncodedConfig> Visitor<'_> for Helper<CONFIG> {
type Value = OffsetDateTime;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
4 changes: 2 additions & 2 deletions serde_with/src/utils/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ duration_impls!(
);

struct DurationVisitorFlexible;
impl<'de> Visitor<'de> for DurationVisitorFlexible {
impl Visitor<'_> for DurationVisitorFlexible {
type Value = DurationSigned;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down Expand Up @@ -386,7 +386,7 @@ impl<'de> DeserializeAs<'de, DurationSigned> for DurationSeconds<String, Strict>
{
struct DurationDeserializationVisitor;

impl<'de> Visitor<'de> for DurationDeserializationVisitor {
impl Visitor<'_> for DurationDeserializationVisitor {
type Value = DurationSigned;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
20 changes: 10 additions & 10 deletions serde_with/src/with_prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub struct WithPrefix<'a, T> {
pub prefix: &'a str,
}

impl<'a, T> Serialize for WithPrefix<'a, T>
impl<T> Serialize for WithPrefix<'_, T>
where
T: Serialize,
{
Expand Down Expand Up @@ -333,7 +333,7 @@ where
}
}

impl<'a, S> SerializeMap for WithPrefix<'a, S>
impl<S> SerializeMap for WithPrefix<'_, S>
where
S: SerializeMap,
{
Expand Down Expand Up @@ -376,7 +376,7 @@ where
}
}

impl<'a, S> SerializeStruct for WithPrefix<'a, S>
impl<S> SerializeStruct for WithPrefix<'_, S>
where
S: SerializeMap,
{
Expand All @@ -398,7 +398,7 @@ where
}
}

impl<'de, 'a, T> DeserializeSeed<'de> for WithPrefix<'a, T>
impl<'de, T> DeserializeSeed<'de> for WithPrefix<'_, T>
where
T: DeserializeSeed<'de>,
{
Expand All @@ -415,7 +415,7 @@ where
}
}

impl<'de, 'a, D> Deserializer<'de> for WithPrefix<'a, D>
impl<'de, D> Deserializer<'de> for WithPrefix<'_, D>
where
D: Deserializer<'de>,
{
Expand Down Expand Up @@ -459,7 +459,7 @@ where
}
}

impl<'de, 'a, V> Visitor<'de> for WithPrefix<'a, V>
impl<'de, V> Visitor<'de> for WithPrefix<'_, V>
where
V: Visitor<'de>,
{
Expand All @@ -480,7 +480,7 @@ where
}
}

impl<'de, 'a, A> MapAccess<'de> for WithPrefix<'a, A>
impl<'de, A> MapAccess<'de> for WithPrefix<'_, A>
where
A: MapAccess<'de>,
{
Expand Down Expand Up @@ -515,7 +515,7 @@ pub struct WithPrefixOption<'a, T> {
prefix: &'a str,
}

impl<'de, 'a, V> Visitor<'de> for WithPrefixOption<'a, V>
impl<'de, V> Visitor<'de> for WithPrefixOption<'_, V>
where
V: Visitor<'de>,
{
Expand Down Expand Up @@ -550,7 +550,7 @@ where
}
}

impl<'de, 'a, A> Deserializer<'de> for WithPrefixOption<'a, A>
impl<'de, A> Deserializer<'de> for WithPrefixOption<'_, A>
where
A: MapAccess<'de>,
{
Expand All @@ -570,7 +570,7 @@ where
}
}

impl<'de, 'a, A> MapAccess<'de> for WithPrefixOption<'a, A>
impl<'de, A> MapAccess<'de> for WithPrefixOption<'_, A>
where
A: MapAccess<'de>,
{
Expand Down
Loading
Loading