Skip to content

Commit 622007d

Browse files
authored
minor: update clippy to 1.75 (#451)
1 parent 7e11430 commit 622007d

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
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.71.0
8+
CLIPPY_VERSION=1.75.0
99

1010
rustup install $CLIPPY_VERSION
1111

src/tests/modules/bson.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,13 @@ fn from_impls() {
179179

180180
// References
181181
assert_eq!(Bson::from(&24i32), Bson::Int32(24));
182-
assert_eq!(
183-
Bson::try_from(&String::from("data")).unwrap(),
184-
Bson::String(String::from("data"))
185-
);
182+
#[allow(clippy::unnecessary_fallible_conversions)]
183+
{
184+
assert_eq!(
185+
Bson::try_from(&String::from("data")).unwrap(),
186+
Bson::String(String::from("data"))
187+
);
188+
}
186189
assert_eq!(Bson::from(&oid), Bson::ObjectId(oid));
187190
assert_eq!(
188191
Bson::from(&doc! {"a": "b"}),

src/tests/modules/macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn recursive_macro() {
159159
assert_eq!(2, arr.len());
160160

161161
// Match array items
162-
match arr.get(0) {
162+
match arr.first() {
163163
Some(Bson::String(ref s)) => assert_eq!("seal", s),
164164
_ => panic!(
165165
"String 'seal' was not inserted into inner array correctly."
@@ -193,7 +193,7 @@ fn recursive_macro() {
193193
assert_eq!(1, arr.len());
194194

195195
// Integer type
196-
match arr.get(0) {
196+
match arr.first() {
197197
Some(Bson::Int32(ref i)) => assert_eq!(-7, *i),
198198
_ => panic!("I32 '-7' was not inserted correctly."),
199199
}
@@ -207,7 +207,7 @@ fn recursive_macro() {
207207
assert_eq!(1, arr.len());
208208

209209
// Nested document
210-
match arr.get(0) {
210+
match arr.first() {
211211
Some(Bson::Document(ref doc)) => {
212212
// String
213213
match doc.get("apple") {

0 commit comments

Comments
 (0)