Skip to content

Commit 20675ff

Browse files
RUST-1398 Pin clippy version to 1.62.0 (#366)
1 parent e2c925e commit 20675ff

File tree

7 files changed

+13
-8
lines changed

7 files changed

+13
-8
lines changed

.evergreen/check-clippy.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ set -o errexit
44

55
. ~/.cargo/env
66

7-
cargo clippy --all-targets --all-features -p bson -- -D warnings
7+
# Pin clippy to the latest version. This should be updated when new versions of Rust are released.
8+
CLIPPY_VERSION=1.62.0
9+
10+
rustup install $CLIPPY_VERSION
11+
12+
cargo +$CLIPPY_VERSION clippy --all-targets --all-features -p bson -- -D warnings
813

914
cd serde-tests
10-
cargo clippy --all-targets --all-features -p serde-tests -- -D warnings
15+
cargo +$CLIPPY_VERSION clippy --all-targets --all-features -p serde-tests -- -D warnings

src/datetime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ impl crate::DateTime {
292292
} else {
293293
// need to convert to i128 before calculating absolute value since i64::MIN.abs()
294294
// overflows and panics.
295-
SystemTime::UNIX_EPOCH - Duration::from_millis((self.0 as i128).abs() as u64)
295+
SystemTime::UNIX_EPOCH - Duration::from_millis((self.0 as i128).unsigned_abs() as u64)
296296
}
297297
}
298298

src/de/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,7 @@ struct RawBsonDeserializer<'a> {
16731673
value: BsonContent<'a>,
16741674
}
16751675

1676-
impl<'de, 'a> serde::de::Deserializer<'de> for RawBsonDeserializer<'de> {
1676+
impl<'de> serde::de::Deserializer<'de> for RawBsonDeserializer<'de> {
16771677
type Error = Error;
16781678

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

src/document.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl FromIterator<(String, Bson)> for Document {
165165
}
166166
}
167167

168-
impl<'a> Iterator for IntoIter {
168+
impl Iterator for IntoIter {
169169
type Item = (String, Bson);
170170

171171
fn next(&mut self) -> Option<(String, Bson)> {

src/raw/bson.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ impl Serialize for RawBson {
447447
}
448448
}
449449

450-
impl<'a> TryFrom<RawBson> for Bson {
450+
impl TryFrom<RawBson> for Bson {
451451
type Error = Error;
452452

453453
fn try_from(rawbson: RawBson) -> Result<Bson> {

src/raw/test/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ fn null() {
249249
let rawdoc = rawdoc! {
250250
"null": null,
251251
};
252-
let () = rawdoc
252+
rawdoc
253253
.get("null")
254254
.expect("error finding key null")
255255
.expect("no key null")

src/tests/modules/bson.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ fn system_time() {
433433
);
434434
assert_eq!(
435435
crate::DateTime::MIN.to_system_time(),
436-
SystemTime::UNIX_EPOCH - Duration::from_millis((i64::MIN as i128).abs() as u64)
436+
SystemTime::UNIX_EPOCH - Duration::from_millis((i64::MIN as i128).unsigned_abs() as u64)
437437
);
438438

439439
assert_eq!(

0 commit comments

Comments
 (0)