Skip to content

Commit 27457be

Browse files
minor: bump clippy to 1.84 (#1307)
1 parent 592cb38 commit 27457be

File tree

19 files changed

+26
-34
lines changed

19 files changed

+26
-34
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
source ./.evergreen/env.sh
66

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

1010
rustup install $CLIPPY_VERSION
1111

src/action/find_and_modify.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ use crate::{
2727
use super::{action_impl, deeplink, export_doc, option_setters, options_doc};
2828

2929
impl<T: DeserializeOwned + Send + Sync> Collection<T> {
30-
async fn find_and_modify<'a>(
30+
async fn find_and_modify(
3131
&self,
3232
filter: Document,
3333
modification: Modification,
3434
mut options: Option<FindAndModifyOptions>,
35-
session: Option<&'a mut ClientSession>,
35+
session: Option<&mut ClientSession>,
3636
) -> Result<Option<T>> {
3737
resolve_write_concern_with_session!(self, options, session.as_ref())?;
3838

src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl Client {
261261
.read()
262262
.await
263263
.as_ref()
264-
.map_or(false, |cs| cs.exec().mongocryptd_spawned())
264+
.is_some_and(|cs| cs.exec().mongocryptd_spawned())
265265
}
266266

267267
#[cfg(all(test, feature = "in-use-encryption"))]
@@ -271,7 +271,7 @@ impl Client {
271271
.read()
272272
.await
273273
.as_ref()
274-
.map_or(false, |cs| cs.exec().has_mongocryptd_client())
274+
.is_some_and(|cs| cs.exec().has_mongocryptd_client())
275275
}
276276

277277
fn test_command_event_channel(&self) -> Option<&options::TestEventSender> {

src/client/action/perf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ impl<'a> Action for crate::action::WarmConnectionPool<'a> {
1010
.inner
1111
.options
1212
.min_pool_size
13-
.map_or(false, |s| s > 0)
13+
.is_some_and(|size| size > 0)
1414
{
1515
// No-op when min_pool_size is zero.
1616
return;

src/client/auth/aws.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ impl ServerFirst {
542542
MECH_NAME,
543543
"sts host must be non-empty",
544544
))
545-
} else if self.sts_host.as_bytes().len() > 255 {
545+
} else if self.sts_host.len() > 255 {
546546
Err(Error::authentication_error(
547547
MECH_NAME,
548548
"sts host cannot be more than 255 bytes",

src/client/auth/oidc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ pub(super) fn validate_credential(credential: &Credential) -> Result<()> {
968968
if credential
969969
.source
970970
.as_ref()
971-
.map_or(false, |s| s != "$external")
971+
.is_some_and(|source| source != "$external")
972972
{
973973
return Err(Error::invalid_argument(format!(
974974
"source must be $external for {} authentication, found: {:?}",

src/client/csfle/client_encryption.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl ClientEncryption {
183183

184184
/// Decrypts an encrypted value (BSON binary of subtype 6).
185185
/// Returns the original BSON value.
186-
pub async fn decrypt<'a>(&self, value: RawBinaryRef<'a>) -> Result<bson::RawBson> {
186+
pub async fn decrypt(&self, value: RawBinaryRef<'_>) -> Result<bson::RawBson> {
187187
if value.subtype != BinarySubtype::Encrypted {
188188
return Err(Error::invalid_argument(format!(
189189
"Invalid binary subtype for decrypt: expected {:?}, got {:?}",

src/client/options/test.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ async fn run_tests(path: &[&str], skipped_files: &[&str]) {
154154

155155
let (_, actual_value) = actual_options
156156
.iter()
157-
.find(|(actual_key, _)| {
158-
actual_key.to_ascii_lowercase() == expected_key.to_ascii_lowercase()
159-
})
157+
.find(|(actual_key, _)| actual_key.eq_ignore_ascii_case(expected_key))
160158
.unwrap_or_else(|| {
161159
panic!(
162160
"{}: parsed options missing {} key",

src/client/session/action.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'a> Action for StartTransaction<&'a mut ClientSession> {
9999
}
100100
}
101101

102-
impl<'a> StartTransaction<&'a mut ClientSession> {
102+
impl StartTransaction<&mut ClientSession> {
103103
/// Starts a transaction, runs the given callback, and commits or aborts the transaction.
104104
/// Transient transaction errors will cause the callback or the commit to be retried;
105105
/// other errors will cause the transaction to be aborted and the error returned to the

src/cmap/conn/stream_description.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ impl StreamDescription {
7676
pub(crate) fn supports_retryable_writes(&self) -> bool {
7777
self.initial_server_type != ServerType::Standalone
7878
&& self.logical_session_timeout.is_some()
79-
&& self.max_wire_version.map_or(false, |version| version >= 6)
79+
&& self.max_wire_version.is_some_and(|version| version >= 6)
8080
}
8181
}

0 commit comments

Comments
 (0)