Skip to content

Commit e0aab6f

Browse files
minor: bump clippy version to 1.83.0 (#509)
1 parent cea6aec commit e0aab6f

17 files changed

+60
-60
lines changed

.evergreen/check-clippy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -o errexit
55
. ~/.cargo/env
66

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

1010
rustup install $CLIPPY_VERSION
1111

src/de/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ where
9191
let de = Deserializer::new(bson);
9292
#[cfg(feature = "serde_path_to_error")]
9393
{
94-
return serde_path_to_error::deserialize(de).map_err(Error::with_path);
94+
serde_path_to_error::deserialize(de).map_err(Error::with_path)
9595
}
9696
#[cfg(not(feature = "serde_path_to_error"))]
9797
{

src/de/raw.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ struct TimestampAccess<'d> {
730730
deserializer: &'d mut TimestampDeserializer,
731731
}
732732

733-
impl<'de, 'd> serde::de::MapAccess<'de> for TimestampAccess<'d> {
733+
impl<'de> serde::de::MapAccess<'de> for TimestampAccess<'_> {
734734
type Error = Error;
735735

736736
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
@@ -775,7 +775,7 @@ impl TimestampDeserializer {
775775
}
776776
}
777777

778-
impl<'de, 'a> serde::de::Deserializer<'de> for &'a mut TimestampDeserializer {
778+
impl<'de> serde::de::Deserializer<'de> for &mut TimestampDeserializer {
779779
type Error = Error;
780780

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

826-
impl<'de, 'd> serde::de::MapAccess<'de> for DateTimeAccess<'d> {
826+
impl<'de> serde::de::MapAccess<'de> for DateTimeAccess<'_> {
827827
type Error = Error;
828828

829829
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
@@ -875,7 +875,7 @@ impl DateTimeDeserializer {
875875
}
876876
}
877877

878-
impl<'de, 'a> serde::de::Deserializer<'de> for &'a mut DateTimeDeserializer {
878+
impl<'de> serde::de::Deserializer<'de> for &mut DateTimeDeserializer {
879879
type Error = Error;
880880

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

935-
impl<'de, 'd> serde::de::MapAccess<'de> for BinaryAccess<'d, 'de> {
935+
impl<'de> serde::de::MapAccess<'de> for BinaryAccess<'_, 'de> {
936936
type Error = Error;
937937

938938
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
@@ -976,7 +976,7 @@ impl<'a> BinaryDeserializer<'a> {
976976
}
977977
}
978978

979-
impl<'de, 'a> serde::de::Deserializer<'de> for &'a mut BinaryDeserializer<'de> {
979+
impl<'de> serde::de::Deserializer<'de> for &mut BinaryDeserializer<'de> {
980980
type Error = Error;
981981

982982
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
@@ -1084,7 +1084,7 @@ impl<'de> serde::de::MapAccess<'de> for CodeWithScopeAccess<'de> {
10841084
}
10851085
}
10861086

1087-
impl<'a, 'de> serde::de::Deserializer<'de> for &'a CodeWithScopeAccess<'de> {
1087+
impl<'de> serde::de::Deserializer<'de> for &CodeWithScopeAccess<'de> {
10881088
type Error = Error;
10891089

10901090
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
@@ -1180,7 +1180,7 @@ impl<'de> serde::de::MapAccess<'de> for DbPointerAccess<'de> {
11801180
}
11811181
}
11821182

1183-
impl<'a, 'de> serde::de::Deserializer<'de> for &'a mut DbPointerAccess<'de> {
1183+
impl<'de> serde::de::Deserializer<'de> for &mut DbPointerAccess<'de> {
11841184
type Error = Error;
11851185

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

1292-
impl<'a, 'de> serde::de::Deserializer<'de> for &'a mut RegexAccess<'de> {
1292+
impl<'de> serde::de::Deserializer<'de> for &mut RegexAccess<'de> {
12931293
type Error = Error;
12941294

12951295
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>

src/document.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ pub struct VacantEntry<'a> {
696696
inner: indexmap::map::VacantEntry<'a, String, Bson>,
697697
}
698698

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

712-
impl<'a> OccupiedEntry<'a> {
712+
impl OccupiedEntry<'_> {
713713
/// Gets a reference to the key in the entry.
714714
pub fn key(&self) -> &str {
715715
self.inner.key()

src/raw/array.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,14 @@ impl<'de: 'a, 'a> Deserialize<'de> for &'a RawArray {
304304
}
305305
}
306306

307-
impl<'a> Serialize for &'a RawArray {
307+
impl Serialize for &RawArray {
308308
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
309309
where
310310
S: serde::Serializer,
311311
{
312312
struct SeqSerializer<'a>(&'a RawArray);
313313

314-
impl<'a> Serialize for SeqSerializer<'a> {
314+
impl Serialize for SeqSerializer<'_> {
315315
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
316316
where
317317
S: serde::Serializer,

src/raw/array_buf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl<'a> IntoIterator for &'a RawArrayBuf {
136136
}
137137
}
138138

139-
impl<'a> From<RawArrayBuf> for Cow<'a, RawArray> {
139+
impl From<RawArrayBuf> for Cow<'_, RawArray> {
140140
fn from(rd: RawArrayBuf) -> Self {
141141
Cow::Owned(rd)
142142
}

src/raw/bson_ref.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawBsonRef<'a> {
312312
}
313313
}
314314

315-
impl<'a> Serialize for RawBsonRef<'a> {
315+
impl Serialize for RawBsonRef<'_> {
316316
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
317317
where
318318
S: serde::Serializer,
@@ -371,13 +371,13 @@ impl<'a> TryFrom<RawBsonRef<'a>> for Bson {
371371
}
372372
}
373373

374-
impl<'a> From<i32> for RawBsonRef<'a> {
374+
impl From<i32> for RawBsonRef<'_> {
375375
fn from(i: i32) -> Self {
376376
RawBsonRef::Int32(i)
377377
}
378378
}
379379

380-
impl<'a> From<i64> for RawBsonRef<'a> {
380+
impl From<i64> for RawBsonRef<'_> {
381381
fn from(i: i64) -> Self {
382382
RawBsonRef::Int64(i)
383383
}
@@ -389,13 +389,13 @@ impl<'a> From<&'a str> for RawBsonRef<'a> {
389389
}
390390
}
391391

392-
impl<'a> From<f64> for RawBsonRef<'a> {
392+
impl From<f64> for RawBsonRef<'_> {
393393
fn from(f: f64) -> Self {
394394
RawBsonRef::Double(f)
395395
}
396396
}
397397

398-
impl<'a> From<bool> for RawBsonRef<'a> {
398+
impl From<bool> for RawBsonRef<'_> {
399399
fn from(b: bool) -> Self {
400400
RawBsonRef::Boolean(b)
401401
}
@@ -425,25 +425,25 @@ impl<'a> From<&'a RawArrayBuf> for RawBsonRef<'a> {
425425
}
426426
}
427427

428-
impl<'a> From<crate::DateTime> for RawBsonRef<'a> {
428+
impl From<crate::DateTime> for RawBsonRef<'_> {
429429
fn from(dt: crate::DateTime) -> Self {
430430
RawBsonRef::DateTime(dt)
431431
}
432432
}
433433

434-
impl<'a> From<Timestamp> for RawBsonRef<'a> {
434+
impl From<Timestamp> for RawBsonRef<'_> {
435435
fn from(ts: Timestamp) -> Self {
436436
RawBsonRef::Timestamp(ts)
437437
}
438438
}
439439

440-
impl<'a> From<ObjectId> for RawBsonRef<'a> {
440+
impl From<ObjectId> for RawBsonRef<'_> {
441441
fn from(oid: ObjectId) -> Self {
442442
RawBsonRef::ObjectId(oid)
443443
}
444444
}
445445

446-
impl<'a> From<Decimal128> for RawBsonRef<'a> {
446+
impl From<Decimal128> for RawBsonRef<'_> {
447447
fn from(d: Decimal128) -> Self {
448448
RawBsonRef::Decimal128(d)
449449
}
@@ -459,7 +459,7 @@ pub struct RawBinaryRef<'a> {
459459
pub bytes: &'a [u8],
460460
}
461461

462-
impl<'a> RawBinaryRef<'a> {
462+
impl RawBinaryRef<'_> {
463463
/// Copy the contents into a [`Binary`].
464464
pub fn to_binary(&self) -> Binary {
465465
Binary {
@@ -491,7 +491,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawBinaryRef<'a> {
491491
}
492492
}
493493

494-
impl<'a> Serialize for RawBinaryRef<'a> {
494+
impl Serialize for RawBinaryRef<'_> {
495495
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
496496
where
497497
S: serde::Serializer,
@@ -569,7 +569,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawRegexRef<'a> {
569569
}
570570
}
571571

572-
impl<'a> Serialize for RawRegexRef<'a> {
572+
impl Serialize for RawRegexRef<'_> {
573573
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
574574
where
575575
S: serde::Serializer,
@@ -606,7 +606,7 @@ pub struct RawJavaScriptCodeWithScopeRef<'a> {
606606
pub scope: &'a RawDocument,
607607
}
608608

609-
impl<'a> RawJavaScriptCodeWithScopeRef<'a> {
609+
impl RawJavaScriptCodeWithScopeRef<'_> {
610610
pub(crate) fn len(self) -> i32 {
611611
4 + 4 + self.code.len() as i32 + 1 + self.scope.as_bytes().len() as i32
612612
}
@@ -627,7 +627,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawJavaScriptCodeWithScopeRef<'a> {
627627
}
628628
}
629629

630-
impl<'a> Serialize for RawJavaScriptCodeWithScopeRef<'a> {
630+
impl Serialize for RawJavaScriptCodeWithScopeRef<'_> {
631631
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
632632
where
633633
S: serde::Serializer,
@@ -667,7 +667,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for RawDbPointerRef<'a> {
667667
}
668668
}
669669

670-
impl<'a> Serialize for RawDbPointerRef<'a> {
670+
impl Serialize for RawDbPointerRef<'_> {
671671
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
672672
where
673673
S: serde::Serializer,

src/raw/document.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -548,14 +548,14 @@ impl<'de: 'a, 'a> Deserialize<'de> for &'a RawDocument {
548548
}
549549
}
550550

551-
impl<'a> Serialize for &'a RawDocument {
551+
impl Serialize for &RawDocument {
552552
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
553553
where
554554
S: serde::Serializer,
555555
{
556556
struct KvpSerializer<'a>(&'a RawDocument);
557557

558-
impl<'a> Serialize for KvpSerializer<'a> {
558+
impl Serialize for KvpSerializer<'_> {
559559
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
560560
where
561561
S: serde::Serializer,

src/raw/document_buf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl std::fmt::Debug for RawDocumentBuf {
268268
}
269269
}
270270

271-
impl<'a> From<RawDocumentBuf> for Cow<'a, RawDocument> {
271+
impl From<RawDocumentBuf> for Cow<'_, RawDocument> {
272272
fn from(rd: RawDocumentBuf) -> Self {
273273
Cow::Owned(rd)
274274
}

src/raw/iter.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ impl<'a> TryInto<RawBsonRef<'a>> for RawElement<'a> {
128128
}
129129
}
130130

131-
impl<'a> TryInto<RawBson> for RawElement<'a> {
131+
impl TryInto<RawBson> for RawElement<'_> {
132132
type Error = Error;
133133

134134
fn try_into(self) -> Result<RawBson> {
135135
Ok(self.value()?.to_raw_bson())
136136
}
137137
}
138138

139-
impl<'a> TryInto<Bson> for RawElement<'a> {
139+
impl TryInto<Bson> for RawElement<'_> {
140140
type Error = Error;
141141

142142
fn try_into(self) -> Result<Bson> {
@@ -340,7 +340,7 @@ impl<'a> RawElement<'a> {
340340
}
341341
}
342342

343-
impl<'a> RawIter<'a> {
343+
impl RawIter<'_> {
344344
fn get_next_length_at(&self, start_at: usize) -> Result<usize> {
345345
let len = i32_from_slice(&self.doc.as_bytes()[start_at..])?;
346346
if len < 0 {

src/raw/serde.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'a, 'de: 'a> Deserialize<'de> for OwnedOrBorrowedRawBson<'a> {
5454
}
5555
}
5656

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

72-
impl<'a> From<RawBson> for OwnedOrBorrowedRawBson<'a> {
72+
impl From<RawBson> for OwnedOrBorrowedRawBson<'_> {
7373
fn from(b: RawBson) -> Self {
7474
OwnedOrBorrowedRawBson::Owned(b)
7575
}
@@ -82,7 +82,7 @@ pub(crate) enum OwnedOrBorrowedRawDocument<'a> {
8282
Borrowed(&'a RawDocument),
8383
}
8484

85-
impl<'a> OwnedOrBorrowedRawDocument<'a> {
85+
impl OwnedOrBorrowedRawDocument<'_> {
8686
pub(crate) fn into_owned(self) -> RawDocumentBuf {
8787
match self {
8888
Self::Owned(o) => o,
@@ -91,7 +91,7 @@ impl<'a> OwnedOrBorrowedRawDocument<'a> {
9191
}
9292
}
9393

94-
impl<'a> From<RawDocumentBuf> for OwnedOrBorrowedRawDocument<'a> {
94+
impl From<RawDocumentBuf> for OwnedOrBorrowedRawDocument<'_> {
9595
fn from(doc: RawDocumentBuf) -> Self {
9696
Self::Owned(doc)
9797
}
@@ -160,7 +160,7 @@ pub(crate) enum OwnedOrBorrowedRawArray<'a> {
160160
Borrowed(&'a RawArray),
161161
}
162162

163-
impl<'a> OwnedOrBorrowedRawArray<'a> {
163+
impl OwnedOrBorrowedRawArray<'_> {
164164
pub(crate) fn into_owned(self) -> RawArrayBuf {
165165
match self {
166166
Self::Owned(o) => o,

src/raw/serde/seeded_visitor.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub(crate) struct SeededVisitor<'a, 'de> {
8282
buffer: &'a mut CowByteBuffer<'de>,
8383
}
8484

85-
impl<'a, 'de> DeserializeSeed<'de> for SeededVisitor<'a, 'de> {
85+
impl<'de> DeserializeSeed<'de> for SeededVisitor<'_, 'de> {
8686
type Value = ElementType;
8787

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

96-
impl<'a, 'de> DeserializeSeed<'de> for &mut SeededVisitor<'a, 'de> {
96+
impl<'de> DeserializeSeed<'de> for &mut SeededVisitor<'_, 'de> {
9797
type Value = ElementType;
9898

9999
fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
@@ -233,7 +233,7 @@ impl<'a, 'de> SeededVisitor<'a, 'de> {
233233
}
234234
}
235235

236-
impl<'a, 'de> Visitor<'de> for SeededVisitor<'a, 'de> {
236+
impl<'de> Visitor<'de> for SeededVisitor<'_, 'de> {
237237
type Value = ElementType;
238238

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

0 commit comments

Comments
 (0)