Skip to content

Commit 460d335

Browse files
authored
RUST-1440 Bump clippy version to 1.63 (#729)
1 parent 6a8ac8e commit 460d335

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

.evergreen/check-clippy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source ./.evergreen/configure-rust.sh
66
source ./.evergreen/feature-combinations.sh
77

88
# Pin clippy to the latest version. This should be updated when new versions of Rust are released.
9-
CLIPPY_VERSION=1.61.0
9+
CLIPPY_VERSION=1.63.0
1010

1111
rustup install $CLIPPY_VERSION
1212

src/client/csfle/state_machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl CryptExecutor {
140140
)
141141
.await?;
142142
stream.write_all(kms_ctx.message()?).await?;
143-
let mut buf = vec![];
143+
let mut buf = vec![0];
144144
while kms_ctx.bytes_needed() > 0 {
145145
let buf_size = kms_ctx.bytes_needed().try_into().map_err(|e| {
146146
Error::internal(format!("buffer size overflow: {}", e))

src/client/options/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::{
77
cmp::Ordering,
88
collections::HashSet,
99
convert::TryFrom,
10-
fmt::{self, Display, Formatter},
10+
fmt::{self, Display, Formatter, Write},
1111
hash::{Hash, Hasher},
1212
path::PathBuf,
1313
str::FromStr,
@@ -2153,10 +2153,11 @@ impl ConnectionString {
21532153
});
21542154
let mut message = format!("{} is an invalid option", other);
21552155
if jaro_winkler >= 0.84 {
2156-
message.push_str(&format!(
2156+
let _ = write!(
2157+
message,
21572158
". An option with a similar name exists: {}",
21582159
option
2159-
));
2160+
);
21602161
}
21612162
return Err(ErrorKind::InvalidArgument { message }.into());
21622163
}

src/cursor/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,9 @@ impl GetMoreProvider for ImplicitSessionGetMoreProvider {
427427
match self {
428428
Self::Idle(ref mut session) => Box::pin(async move {
429429
let get_more = GetMore::new(info, pinned_connection.handle());
430-
let get_more_result = client
430+
client
431431
.execute_operation(get_more, session.as_mut().map(|b| b.as_mut()))
432-
.await;
433-
get_more_result
432+
.await
434433
}),
435434
Self::Executing(_fut) => Box::pin(async {
436435
Err(Error::internal(

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@
297297
allow(
298298
clippy::unreadable_literal,
299299
clippy::cognitive_complexity,
300-
clippy::float_cmp
300+
clippy::float_cmp,
301+
clippy::derive_partial_eq_without_eq
301302
)
302303
)]
303304
#![cfg_attr(docsrs, feature(doc_cfg))]

src/test/spec/unified_runner/test_file.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{sync::Arc, time::Duration};
1+
use std::{fmt::Write, sync::Arc, time::Duration};
22

33
use semver::{Version, VersionReq};
44
use serde::{Deserialize, Deserializer};
@@ -212,7 +212,7 @@ pub(crate) fn merge_uri_options(given_uri: &str, uri_options: Option<&Document>)
212212
let value = value.to_string();
213213
// to_string() wraps quotations around Bson strings
214214
let value = value.trim_start_matches('\"').trim_end_matches('\"');
215-
uri.push_str(&format!("{}={}&", &key, value));
215+
let _ = write!(uri, "{}={}&", &key, value);
216216
}
217217

218218
// remove the trailing '&' from the URI (or '?' if no options are present)

0 commit comments

Comments
 (0)