Skip to content

Commit

Permalink
minor: bump clippy version to 1.83.0 (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelatkinson authored Dec 12, 2024
1 parent cea6aec commit e0aab6f
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .evergreen/check-clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o errexit
. ~/.cargo/env

# Pin clippy to the latest version. This should be updated when new versions of Rust are released.
CLIPPY_VERSION=1.80.0
CLIPPY_VERSION=1.83.0

rustup install $CLIPPY_VERSION

Expand Down
2 changes: 1 addition & 1 deletion src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ where
let de = Deserializer::new(bson);
#[cfg(feature = "serde_path_to_error")]
{
return serde_path_to_error::deserialize(de).map_err(Error::with_path);
serde_path_to_error::deserialize(de).map_err(Error::with_path)
}
#[cfg(not(feature = "serde_path_to_error"))]
{
Expand Down
18 changes: 9 additions & 9 deletions src/de/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ struct TimestampAccess<'d> {
deserializer: &'d mut TimestampDeserializer,
}

impl<'de, 'd> serde::de::MapAccess<'de> for TimestampAccess<'d> {
impl<'de> serde::de::MapAccess<'de> for TimestampAccess<'_> {
type Error = Error;

fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
Expand Down Expand Up @@ -775,7 +775,7 @@ impl TimestampDeserializer {
}
}

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

fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
Expand Down Expand Up @@ -823,7 +823,7 @@ struct DateTimeAccess<'d> {
deserializer: &'d mut DateTimeDeserializer,
}

impl<'de, 'd> serde::de::MapAccess<'de> for DateTimeAccess<'d> {
impl<'de> serde::de::MapAccess<'de> for DateTimeAccess<'_> {
type Error = Error;

fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
Expand Down Expand Up @@ -875,7 +875,7 @@ impl DateTimeDeserializer {
}
}

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

fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
Expand Down Expand Up @@ -932,7 +932,7 @@ struct BinaryAccess<'d, 'de> {
deserializer: &'d mut BinaryDeserializer<'de>,
}

impl<'de, 'd> serde::de::MapAccess<'de> for BinaryAccess<'d, 'de> {
impl<'de> serde::de::MapAccess<'de> for BinaryAccess<'_, 'de> {
type Error = Error;

fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
Expand Down Expand Up @@ -976,7 +976,7 @@ impl<'a> BinaryDeserializer<'a> {
}
}

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

fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
Expand Down Expand Up @@ -1084,7 +1084,7 @@ impl<'de> serde::de::MapAccess<'de> for CodeWithScopeAccess<'de> {
}
}

impl<'a, 'de> serde::de::Deserializer<'de> for &'a CodeWithScopeAccess<'de> {
impl<'de> serde::de::Deserializer<'de> for &CodeWithScopeAccess<'de> {
type Error = Error;

fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
Expand Down Expand Up @@ -1180,7 +1180,7 @@ impl<'de> serde::de::MapAccess<'de> for DbPointerAccess<'de> {
}
}

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

fn deserialize_any<V>(self, visitor: V) -> std::result::Result<V::Value, Self::Error>
Expand Down Expand Up @@ -1289,7 +1289,7 @@ impl<'de> serde::de::MapAccess<'de> for RegexAccess<'de> {
}
}

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

fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
Expand Down
4 changes: 2 additions & 2 deletions src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ pub struct VacantEntry<'a> {
inner: indexmap::map::VacantEntry<'a, String, Bson>,
}

impl<'a> VacantEntry<'a> {
impl VacantEntry<'_> {
/// Gets a reference to the key that would be used when inserting a value through the
/// [VacantEntry].
fn key(&self) -> &str {
Expand All @@ -709,7 +709,7 @@ pub struct OccupiedEntry<'a> {
inner: indexmap::map::OccupiedEntry<'a, String, Bson>,
}

impl<'a> OccupiedEntry<'a> {
impl OccupiedEntry<'_> {
/// Gets a reference to the key in the entry.
pub fn key(&self) -> &str {
self.inner.key()
Expand Down
4 changes: 2 additions & 2 deletions src/raw/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@ impl<'de: 'a, 'a> Deserialize<'de> for &'a RawArray {
}
}

impl<'a> Serialize for &'a RawArray {
impl Serialize for &RawArray {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
struct SeqSerializer<'a>(&'a RawArray);

impl<'a> Serialize for SeqSerializer<'a> {
impl Serialize for SeqSerializer<'_> {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand Down
2 changes: 1 addition & 1 deletion src/raw/array_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl<'a> IntoIterator for &'a RawArrayBuf {
}
}

impl<'a> From<RawArrayBuf> for Cow<'a, RawArray> {
impl From<RawArrayBuf> for Cow<'_, RawArray> {
fn from(rd: RawArrayBuf) -> Self {
Cow::Owned(rd)
}
Expand Down
30 changes: 15 additions & 15 deletions src/raw/bson_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawBsonRef<'a> {
}
}

impl<'a> Serialize for RawBsonRef<'a> {
impl Serialize for RawBsonRef<'_> {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand Down Expand Up @@ -371,13 +371,13 @@ impl<'a> TryFrom<RawBsonRef<'a>> for Bson {
}
}

impl<'a> From<i32> for RawBsonRef<'a> {
impl From<i32> for RawBsonRef<'_> {
fn from(i: i32) -> Self {
RawBsonRef::Int32(i)
}
}

impl<'a> From<i64> for RawBsonRef<'a> {
impl From<i64> for RawBsonRef<'_> {
fn from(i: i64) -> Self {
RawBsonRef::Int64(i)
}
Expand All @@ -389,13 +389,13 @@ impl<'a> From<&'a str> for RawBsonRef<'a> {
}
}

impl<'a> From<f64> for RawBsonRef<'a> {
impl From<f64> for RawBsonRef<'_> {
fn from(f: f64) -> Self {
RawBsonRef::Double(f)
}
}

impl<'a> From<bool> for RawBsonRef<'a> {
impl From<bool> for RawBsonRef<'_> {
fn from(b: bool) -> Self {
RawBsonRef::Boolean(b)
}
Expand Down Expand Up @@ -425,25 +425,25 @@ impl<'a> From<&'a RawArrayBuf> for RawBsonRef<'a> {
}
}

impl<'a> From<crate::DateTime> for RawBsonRef<'a> {
impl From<crate::DateTime> for RawBsonRef<'_> {
fn from(dt: crate::DateTime) -> Self {
RawBsonRef::DateTime(dt)
}
}

impl<'a> From<Timestamp> for RawBsonRef<'a> {
impl From<Timestamp> for RawBsonRef<'_> {
fn from(ts: Timestamp) -> Self {
RawBsonRef::Timestamp(ts)
}
}

impl<'a> From<ObjectId> for RawBsonRef<'a> {
impl From<ObjectId> for RawBsonRef<'_> {
fn from(oid: ObjectId) -> Self {
RawBsonRef::ObjectId(oid)
}
}

impl<'a> From<Decimal128> for RawBsonRef<'a> {
impl From<Decimal128> for RawBsonRef<'_> {
fn from(d: Decimal128) -> Self {
RawBsonRef::Decimal128(d)
}
Expand All @@ -459,7 +459,7 @@ pub struct RawBinaryRef<'a> {
pub bytes: &'a [u8],
}

impl<'a> RawBinaryRef<'a> {
impl RawBinaryRef<'_> {
/// Copy the contents into a [`Binary`].
pub fn to_binary(&self) -> Binary {
Binary {
Expand Down Expand Up @@ -491,7 +491,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawBinaryRef<'a> {
}
}

impl<'a> Serialize for RawBinaryRef<'a> {
impl Serialize for RawBinaryRef<'_> {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand Down Expand Up @@ -569,7 +569,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawRegexRef<'a> {
}
}

impl<'a> Serialize for RawRegexRef<'a> {
impl Serialize for RawRegexRef<'_> {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand Down Expand Up @@ -606,7 +606,7 @@ pub struct RawJavaScriptCodeWithScopeRef<'a> {
pub scope: &'a RawDocument,
}

impl<'a> RawJavaScriptCodeWithScopeRef<'a> {
impl RawJavaScriptCodeWithScopeRef<'_> {
pub(crate) fn len(self) -> i32 {
4 + 4 + self.code.len() as i32 + 1 + self.scope.as_bytes().len() as i32
}
Expand All @@ -627,7 +627,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawJavaScriptCodeWithScopeRef<'a> {
}
}

impl<'a> Serialize for RawJavaScriptCodeWithScopeRef<'a> {
impl Serialize for RawJavaScriptCodeWithScopeRef<'_> {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand Down Expand Up @@ -667,7 +667,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawDbPointerRef<'a> {
}
}

impl<'a> Serialize for RawDbPointerRef<'a> {
impl Serialize for RawDbPointerRef<'_> {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand Down
4 changes: 2 additions & 2 deletions src/raw/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,14 @@ impl<'de: 'a, 'a> Deserialize<'de> for &'a RawDocument {
}
}

impl<'a> Serialize for &'a RawDocument {
impl Serialize for &RawDocument {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
struct KvpSerializer<'a>(&'a RawDocument);

impl<'a> Serialize for KvpSerializer<'a> {
impl Serialize for KvpSerializer<'_> {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand Down
2 changes: 1 addition & 1 deletion src/raw/document_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl std::fmt::Debug for RawDocumentBuf {
}
}

impl<'a> From<RawDocumentBuf> for Cow<'a, RawDocument> {
impl From<RawDocumentBuf> for Cow<'_, RawDocument> {
fn from(rd: RawDocumentBuf) -> Self {
Cow::Owned(rd)
}
Expand Down
6 changes: 3 additions & 3 deletions src/raw/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ impl<'a> TryInto<RawBsonRef<'a>> for RawElement<'a> {
}
}

impl<'a> TryInto<RawBson> for RawElement<'a> {
impl TryInto<RawBson> for RawElement<'_> {
type Error = Error;

fn try_into(self) -> Result<RawBson> {
Ok(self.value()?.to_raw_bson())
}
}

impl<'a> TryInto<Bson> for RawElement<'a> {
impl TryInto<Bson> for RawElement<'_> {
type Error = Error;

fn try_into(self) -> Result<Bson> {
Expand Down Expand Up @@ -340,7 +340,7 @@ impl<'a> RawElement<'a> {
}
}

impl<'a> RawIter<'a> {
impl RawIter<'_> {
fn get_next_length_at(&self, start_at: usize) -> Result<usize> {
let len = i32_from_slice(&self.doc.as_bytes()[start_at..])?;
if len < 0 {
Expand Down
10 changes: 5 additions & 5 deletions src/raw/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl<'a, 'de: 'a> Deserialize<'de> for OwnedOrBorrowedRawBson<'a> {
}
}

impl<'a> Debug for OwnedOrBorrowedRawBson<'a> {
impl Debug for OwnedOrBorrowedRawBson<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Owned(o) => o.fmt(f),
Expand All @@ -69,7 +69,7 @@ impl<'a> From<RawBsonRef<'a>> for OwnedOrBorrowedRawBson<'a> {
}
}

impl<'a> From<RawBson> for OwnedOrBorrowedRawBson<'a> {
impl From<RawBson> for OwnedOrBorrowedRawBson<'_> {
fn from(b: RawBson) -> Self {
OwnedOrBorrowedRawBson::Owned(b)
}
Expand All @@ -82,7 +82,7 @@ pub(crate) enum OwnedOrBorrowedRawDocument<'a> {
Borrowed(&'a RawDocument),
}

impl<'a> OwnedOrBorrowedRawDocument<'a> {
impl OwnedOrBorrowedRawDocument<'_> {
pub(crate) fn into_owned(self) -> RawDocumentBuf {
match self {
Self::Owned(o) => o,
Expand All @@ -91,7 +91,7 @@ impl<'a> OwnedOrBorrowedRawDocument<'a> {
}
}

impl<'a> From<RawDocumentBuf> for OwnedOrBorrowedRawDocument<'a> {
impl From<RawDocumentBuf> for OwnedOrBorrowedRawDocument<'_> {
fn from(doc: RawDocumentBuf) -> Self {
Self::Owned(doc)
}
Expand Down Expand Up @@ -160,7 +160,7 @@ pub(crate) enum OwnedOrBorrowedRawArray<'a> {
Borrowed(&'a RawArray),
}

impl<'a> OwnedOrBorrowedRawArray<'a> {
impl OwnedOrBorrowedRawArray<'_> {
pub(crate) fn into_owned(self) -> RawArrayBuf {
match self {
Self::Owned(o) => o,
Expand Down
6 changes: 3 additions & 3 deletions src/raw/serde/seeded_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub(crate) struct SeededVisitor<'a, 'de> {
buffer: &'a mut CowByteBuffer<'de>,
}

impl<'a, 'de> DeserializeSeed<'de> for SeededVisitor<'a, 'de> {
impl<'de> DeserializeSeed<'de> for SeededVisitor<'_, 'de> {
type Value = ElementType;

fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
Expand All @@ -93,7 +93,7 @@ impl<'a, 'de> DeserializeSeed<'de> for SeededVisitor<'a, 'de> {
}
}

impl<'a, 'de> DeserializeSeed<'de> for &mut SeededVisitor<'a, 'de> {
impl<'de> DeserializeSeed<'de> for &mut SeededVisitor<'_, 'de> {
type Value = ElementType;

fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
Expand Down Expand Up @@ -233,7 +233,7 @@ impl<'a, 'de> SeededVisitor<'a, 'de> {
}
}

impl<'a, 'de> Visitor<'de> for SeededVisitor<'a, 'de> {
impl<'de> Visitor<'de> for SeededVisitor<'_, 'de> {
type Value = ElementType;

fn expecting(&self, formatter: &mut Formatter) -> std::fmt::Result {
Expand Down
Loading

0 comments on commit e0aab6f

Please sign in to comment.