Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Nov 3, 2024
1 parent d3383bd commit 72fa190
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
workflow_dispatch:
schedule: [cron: "40 1 * * *"]
schedule: [cron: "40 1 1 * *"]

permissions:
contents: read
Expand Down
12 changes: 6 additions & 6 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ fn usize_conversion(e: std::num::TryFromIntError) -> Error {
Error::Io(std::io::Error::new(std::io::ErrorKind::InvalidData, e))
}

impl<'de, 'a, R: Read> de::Deserializer<'de> for &'a mut Deserializer<R> {
impl<'de, R: Read> de::Deserializer<'de> for &mut Deserializer<R> {
type Error = Error;

fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
Expand Down Expand Up @@ -575,7 +575,7 @@ impl<'de, 'a, R: Read> de::Deserializer<'de> for &'a mut Deserializer<R> {
}
}

impl<'de, 'a, R: Read> de::SeqAccess<'de> for &'a mut Deserializer<R> {
impl<'de, R: Read> de::SeqAccess<'de> for &mut Deserializer<R> {
type Error = Error;

fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>>
Expand All @@ -590,7 +590,7 @@ impl<'de, 'a, R: Read> de::SeqAccess<'de> for &'a mut Deserializer<R> {
}
}

impl<'de, 'a, R: Read> de::MapAccess<'de> for &'a mut Deserializer<R> {
impl<'de, R: Read> de::MapAccess<'de> for &mut Deserializer<R> {
type Error = Error;

fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
Expand All @@ -605,11 +605,11 @@ impl<'de, 'a, R: Read> de::MapAccess<'de> for &'a mut Deserializer<R> {
V: de::DeserializeSeed<'de>,
{
self.next_element_seed(seed)
.and_then(|opt| opt.ok_or_else(|| Error::Empty))
.and_then(|opt| opt.ok_or(Error::Empty))
}
}

impl<'de, 'a, R: Read> de::EnumAccess<'de> for &'a mut Deserializer<R> {
impl<'de, R: Read> de::EnumAccess<'de> for &mut Deserializer<R> {
type Error = Error;
type Variant = Self;

Expand All @@ -622,7 +622,7 @@ impl<'de, 'a, R: Read> de::EnumAccess<'de> for &'a mut Deserializer<R> {
}
}

impl<'de, 'a, R: Read> de::VariantAccess<'de> for &'a mut Deserializer<R> {
impl<'de, R: Read> de::VariantAccess<'de> for &mut Deserializer<R> {
type Error = Error;

fn unit_variant(self) -> Result<()> {
Expand Down
20 changes: 10 additions & 10 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl<'a> ser::Serializer for &'a mut Serializer {
}
}

impl<'a> ser::SerializeSeq for JsonbWriter<'a> {
impl ser::SerializeSeq for JsonbWriter<'_> {
type Ok = ();

type Error = Error;
Expand All @@ -301,7 +301,7 @@ impl<'a> ser::SerializeSeq for JsonbWriter<'a> {
}
}

impl<'a> ser::SerializeTuple for JsonbWriter<'a> {
impl ser::SerializeTuple for JsonbWriter<'_> {
type Ok = ();

type Error = Error;
Expand All @@ -318,7 +318,7 @@ impl<'a> ser::SerializeTuple for JsonbWriter<'a> {
}
}

impl<'a> ser::SerializeTupleStruct for JsonbWriter<'a> {
impl ser::SerializeTupleStruct for JsonbWriter<'_> {
type Ok = ();

type Error = Error;
Expand Down Expand Up @@ -364,7 +364,7 @@ impl<'a> EnumVariantSerializer<'a> {
}
}

impl<'a> ser::SerializeTupleVariant for EnumVariantSerializer<'a> {
impl ser::SerializeTupleVariant for EnumVariantSerializer<'_> {
type Ok = ();

type Error = Error;
Expand All @@ -391,7 +391,7 @@ impl<'a> ser::SerializeTupleVariant for EnumVariantSerializer<'a> {
}
}

impl<'a> ser::SerializeMap for JsonbWriter<'a> {
impl ser::SerializeMap for JsonbWriter<'_> {
type Ok = ();

type Error = Error;
Expand All @@ -413,7 +413,7 @@ impl<'a> ser::SerializeMap for JsonbWriter<'a> {
}
}

impl<'a> ser::SerializeStruct for JsonbWriter<'a> {
impl ser::SerializeStruct for JsonbWriter<'_> {
type Ok = ();

type Error = Error;
Expand All @@ -433,7 +433,7 @@ impl<'a> ser::SerializeStruct for JsonbWriter<'a> {
}
}

impl<'a> ser::SerializeStructVariant for EnumVariantSerializer<'a> {
impl ser::SerializeStructVariant for EnumVariantSerializer<'_> {
type Ok = ();

type Error = Error;
Expand Down Expand Up @@ -484,7 +484,7 @@ mod tests {
let long_str = "x".repeat(repeats);
assert_eq!(
to_vec(&long_str).unwrap(),
[&expected_header[..], &long_str.as_bytes()].concat()
[expected_header, long_str.as_bytes()].concat()
);
}

Expand Down Expand Up @@ -523,8 +523,8 @@ mod tests {
struct TupleStruct(String, f32);

assert_eq!(
to_vec(&TupleStruct("hello".to_string(), 3.14)).unwrap(),
b"\xbb\x5ahello\x453.14"
to_vec(&TupleStruct("hello".to_string(), 3.25)).unwrap(),
b"\xbb\x5ahello\x453.25"
);
}

Expand Down

0 comments on commit 72fa190

Please sign in to comment.