Skip to content

Commit c278f6c

Browse files
minor: bump clippy to 1.71 (#424)
1 parent 09a8cbb commit c278f6c

File tree

6 files changed

+23
-26
lines changed

6 files changed

+23
-26
lines changed

.evergreen/check-clippy.sh

Lines changed: 1 addition & 1 deletion
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.65.0
8+
CLIPPY_VERSION=1.71.0
99

1010
rustup install $CLIPPY_VERSION
1111

clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.60.0"

src/de/raw.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ impl TimestampDeserializer {
995995
impl<'de, 'a> serde::de::Deserializer<'de> for &'a mut TimestampDeserializer {
996996
type Error = Error;
997997

998-
fn deserialize_any<V>(mut self, visitor: V) -> Result<V::Value>
998+
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
999999
where
10001000
V: serde::de::Visitor<'de>,
10011001
{
@@ -1095,7 +1095,7 @@ impl DateTimeDeserializer {
10951095
impl<'de, 'a> serde::de::Deserializer<'de> for &'a mut DateTimeDeserializer {
10961096
type Error = Error;
10971097

1098-
fn deserialize_any<V>(mut self, visitor: V) -> Result<V::Value>
1098+
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
10991099
where
11001100
V: serde::de::Visitor<'de>,
11011101
{
@@ -1196,7 +1196,7 @@ impl<'a> BinaryDeserializer<'a> {
11961196
impl<'de, 'a> serde::de::Deserializer<'de> for &'a mut BinaryDeserializer<'de> {
11971197
type Error = Error;
11981198

1199-
fn deserialize_any<V>(mut self, visitor: V) -> Result<V::Value>
1199+
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
12001200
where
12011201
V: serde::de::Visitor<'de>,
12021202
{
@@ -1330,7 +1330,7 @@ impl<'de, 'a> CodeWithScopeDeserializer<'de, 'a> {
13301330
impl<'de, 'a, 'b> serde::de::Deserializer<'de> for &'b mut CodeWithScopeDeserializer<'de, 'a> {
13311331
type Error = Error;
13321332

1333-
fn deserialize_any<V>(mut self, visitor: V) -> Result<V::Value>
1333+
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
13341334
where
13351335
V: serde::de::Visitor<'de>,
13361336
{
@@ -1447,7 +1447,7 @@ impl<'de, 'a> DbPointerDeserializer<'de, 'a> {
14471447
impl<'de, 'a, 'b> serde::de::Deserializer<'de> for &'b mut DbPointerDeserializer<'de, 'a> {
14481448
type Error = Error;
14491449

1450-
fn deserialize_any<V>(mut self, visitor: V) -> Result<V::Value>
1450+
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
14511451
where
14521452
V: serde::de::Visitor<'de>,
14531453
{

src/document.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl Document {
253253
/// Get a reference to a Decimal128 value for key, if it exists.
254254
pub fn get_decimal128(&self, key: impl AsRef<str>) -> ValueAccessResult<&Decimal128> {
255255
match self.get(key) {
256-
Some(&Bson::Decimal128(ref v)) => Ok(v),
256+
Some(Bson::Decimal128(v)) => Ok(v),
257257
Some(_) => Err(ValueAccessError::UnexpectedType),
258258
None => Err(ValueAccessError::NotPresent),
259259
}
@@ -274,7 +274,7 @@ impl Document {
274274
/// Get a string slice this key if it exists and has the correct type.
275275
pub fn get_str(&self, key: impl AsRef<str>) -> ValueAccessResult<&str> {
276276
match self.get(key) {
277-
Some(&Bson::String(ref v)) => Ok(v),
277+
Some(Bson::String(v)) => Ok(v),
278278
Some(_) => Err(ValueAccessError::UnexpectedType),
279279
None => Err(ValueAccessError::NotPresent),
280280
}
@@ -293,7 +293,7 @@ impl Document {
293293
/// the correct type.
294294
pub fn get_array(&self, key: impl AsRef<str>) -> ValueAccessResult<&Array> {
295295
match self.get(key) {
296-
Some(&Bson::Array(ref v)) => Ok(v),
296+
Some(Bson::Array(v)) => Ok(v),
297297
Some(_) => Err(ValueAccessError::UnexpectedType),
298298
None => Err(ValueAccessError::NotPresent),
299299
}
@@ -313,7 +313,7 @@ impl Document {
313313
/// the correct type.
314314
pub fn get_document(&self, key: impl AsRef<str>) -> ValueAccessResult<&Document> {
315315
match self.get(key) {
316-
Some(&Bson::Document(ref v)) => Ok(v),
316+
Some(Bson::Document(v)) => Ok(v),
317317
Some(_) => Err(ValueAccessError::UnexpectedType),
318318
None => Err(ValueAccessError::NotPresent),
319319
}
@@ -458,7 +458,7 @@ impl Document {
458458
/// Get a reference to a UTC datetime value for this key if it exists and has the correct type.
459459
pub fn get_datetime(&self, key: impl AsRef<str>) -> ValueAccessResult<&crate::DateTime> {
460460
match self.get(key) {
461-
Some(&Bson::DateTime(ref v)) => Ok(v),
461+
Some(Bson::DateTime(v)) => Ok(v),
462462
Some(_) => Err(ValueAccessError::UnexpectedType),
463463
None => Err(ValueAccessError::NotPresent),
464464
}

src/ser/raw/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,7 @@ impl<'a> serde::Serializer for &'a mut Serializer {
259259
}
260260

261261
#[inline]
262-
fn serialize_newtype_struct<T: ?Sized>(
263-
mut self,
264-
name: &'static str,
265-
value: &T,
266-
) -> Result<Self::Ok>
262+
fn serialize_newtype_struct<T: ?Sized>(self, name: &'static str, value: &T) -> Result<Self::Ok>
267263
where
268264
T: serde::Serialize,
269265
{

src/tests/modules/macros.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,19 @@ fn recursive_macro() {
143143
};
144144

145145
match doc.get("a") {
146-
Some(&Bson::String(ref s)) => assert_eq!("foo", s),
146+
Some(Bson::String(s)) => assert_eq!("foo", s),
147147
_ => panic!("String 'foo' was not inserted correctly."),
148148
}
149149

150150
// Inner Doc 1
151151
match doc.get("b") {
152-
Some(&Bson::Document(ref doc)) => {
152+
Some(Bson::Document(doc)) => {
153153
// Inner doc 2
154154
match doc.get("bar") {
155-
Some(&Bson::Document(ref inner_doc)) => {
155+
Some(Bson::Document(inner_doc)) => {
156156
// Inner array
157157
match inner_doc.get("harbor") {
158-
Some(&Bson::Array(ref arr)) => {
158+
Some(Bson::Array(arr)) => {
159159
assert_eq!(2, arr.len());
160160

161161
// Match array items
@@ -177,7 +177,7 @@ fn recursive_macro() {
177177

178178
// Inner floating point
179179
match inner_doc.get("jelly") {
180-
Some(&Bson::Double(ref fp)) => assert_eq!(42.0, *fp),
180+
Some(Bson::Double(fp)) => assert_eq!(42.0, *fp),
181181
_ => panic!("Floating point 42.0 was not inserted correctly."),
182182
}
183183
}
@@ -189,7 +189,7 @@ fn recursive_macro() {
189189

190190
// Single-item array
191191
match doc.get("c") {
192-
Some(&Bson::Array(ref arr)) => {
192+
Some(Bson::Array(arr)) => {
193193
assert_eq!(1, arr.len());
194194

195195
// Integer type
@@ -203,15 +203,15 @@ fn recursive_macro() {
203203

204204
// Document nested in array
205205
match doc.get("d") {
206-
Some(&Bson::Array(ref arr)) => {
206+
Some(Bson::Array(arr)) => {
207207
assert_eq!(1, arr.len());
208208

209209
// Nested document
210210
match arr.get(0) {
211211
Some(Bson::Document(ref doc)) => {
212212
// String
213213
match doc.get("apple") {
214-
Some(&Bson::String(ref s)) => assert_eq!("ripe", s),
214+
Some(Bson::String(s)) => assert_eq!("ripe", s),
215215
_ => panic!("String 'ripe' was not inserted correctly."),
216216
}
217217
}
@@ -223,10 +223,10 @@ fn recursive_macro() {
223223

224224
// Single-item document
225225
match doc.get("e") {
226-
Some(&Bson::Document(ref bdoc)) => {
226+
Some(Bson::Document(bdoc)) => {
227227
// String
228228
match bdoc.get("single") {
229-
Some(&Bson::String(ref s)) => assert_eq!("test", s),
229+
Some(Bson::String(s)) => assert_eq!("test", s),
230230
_ => panic!("String 'test' was not inserted correctly."),
231231
}
232232
}

0 commit comments

Comments
 (0)