Skip to content

Commit 2931c6a

Browse files
authored
Update to use clippy 1.67 in CI (#810)
1 parent 910881b commit 2931c6a

File tree

10 files changed

+23
-21
lines changed

10 files changed

+23
-21
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.65.0
9+
CLIPPY_VERSION=1.67.0
1010

1111
rustup install $CLIPPY_VERSION
1212

clippy.toml

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

src/client/options/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ async fn run_connection_string_spec_tests() {
204204
}
205205

206206
async fn parse_uri(option: &str, suggestion: Option<&str>) {
207-
match ConnectionString::parse(&format!("mongodb://host:27017/?{}=test", option))
207+
match ConnectionString::parse(format!("mongodb://host:27017/?{}=test", option))
208208
.map_err(|e| *e.kind)
209209
{
210210
Ok(_) => panic!("expected error for option {}", option),

src/gridfs/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl GridFsBucket {
192192
if n != file.n() {
193193
return Err(ErrorKind::GridFs(GridFsErrorKind::WrongNumberOfChunks {
194194
actual_number: n,
195-
expected_number: file.n() as u32,
195+
expected_number: file.n(),
196196
})
197197
.into());
198198
}

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,16 @@ pub(crate) mod runtime;
335335
mod sdam;
336336
mod selection_criteria;
337337
mod srv;
338-
#[cfg(feature = "tracing-unstable")]
339-
mod trace;
340338
#[cfg(any(feature = "sync", feature = "tokio-sync", docsrs))]
341339
#[cfg_attr(docsrs, doc(cfg(any(feature = "sync", feature = "tokio-sync"))))]
342340
pub mod sync;
343341
#[cfg(test)]
344342
mod test;
343+
#[cfg(feature = "tracing-unstable")]
344+
mod trace;
345345

346+
#[cfg(feature = "in-use-encryption-unstable")]
347+
pub use crate::client::csfle::client_encryption;
346348
pub use crate::{
347349
client::{session::ClientSession, Client},
348350
coll::Collection,
@@ -351,11 +353,9 @@ pub use crate::{
351353
Cursor,
352354
},
353355
db::Database,
354-
gridfs::{GridFsDownloadStream, GridFsBucket, GridFsUploadStream},
356+
gridfs::{GridFsBucket, GridFsDownloadStream, GridFsUploadStream},
355357
};
356358
#[cfg(feature = "in-use-encryption-unstable")]
357-
pub use crate::client::csfle::client_encryption;
358-
#[cfg(feature = "in-use-encryption-unstable")]
359359
pub use ::mongocrypt;
360360

361361
pub use {client::session::ClusterTime, coll::Namespace, index::IndexModel, sdam::public::*};

src/runtime/tls_rustls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{
22
convert::TryFrom,
33
fs::File,
4-
io::{BufReader, Seek, SeekFrom},
4+
io::{BufReader, Seek},
55
pin::Pin,
66
sync::Arc,
77
task::{Context, Poll},
@@ -139,7 +139,7 @@ fn make_rustls_config(cfg: TlsOptions) -> Result<rustls::ClientConfig> {
139139
}
140140
};
141141

142-
file.seek(SeekFrom::Start(0))?;
142+
file.rewind()?;
143143
let key = loop {
144144
match read_one(&mut file) {
145145
Ok(Some(Item::PKCS8Key(bytes))) | Ok(Some(Item::RSAKey(bytes))) => {

src/sdam/description/topology/server_selection/mod.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ impl TopologyDescription {
129129
self.servers.values().any(|server| server.is_available())
130130
}
131131

132-
fn suitable_servers<'a>(
132+
fn suitable_servers(
133133
&self,
134-
read_preference: &'a ReadPreference,
134+
read_preference: &ReadPreference,
135135
) -> Result<Vec<&ServerDescription>> {
136136
let servers = match self.topology_type {
137137
TopologyType::Unknown => Vec::new(),
@@ -145,10 +145,7 @@ impl TopologyDescription {
145145
Ok(servers)
146146
}
147147

148-
fn retain_servers_within_latency_window<'a>(
149-
&self,
150-
suitable_servers: &mut Vec<&'a ServerDescription>,
151-
) {
148+
fn retain_servers_within_latency_window(&self, suitable_servers: &mut Vec<&ServerDescription>) {
152149
let shortest_average_rtt = suitable_servers
153150
.iter()
154151
.filter_map(|server_desc| server_desc.average_round_trip_time)
@@ -189,9 +186,9 @@ impl TopologyDescription {
189186
self.servers_with_type(&[ServerType::RsPrimary]).next()
190187
}
191188

192-
fn suitable_servers_in_replica_set<'a>(
189+
fn suitable_servers_in_replica_set(
193190
&self,
194-
read_preference: &'a ReadPreference,
191+
read_preference: &ReadPreference,
195192
) -> Result<Vec<&ServerDescription>> {
196193
let servers = match read_preference {
197194
ReadPreference::Primary => self.servers_with_type(&[ServerType::RsPrimary]).collect(),
@@ -234,10 +231,10 @@ impl TopologyDescription {
234231
Ok(servers)
235232
}
236233

237-
fn suitable_servers_for_read_preference<'a>(
234+
fn suitable_servers_for_read_preference(
238235
&self,
239236
types: &'static [ServerType],
240-
tag_sets: Option<&'a Vec<TagSet>>,
237+
tag_sets: Option<&Vec<TagSet>>,
241238
max_staleness: Option<Duration>,
242239
) -> Result<Vec<&ServerDescription>> {
243240
if let Some(max_staleness) = max_staleness {

src/sdam/monitor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ impl Monitor {
303303
{
304304
if let Some(ref emitter) = self.sdam_event_emitter {
305305
// We don't care about ordering or waiting for the event to have been received.
306+
#[allow(clippy::let_underscore_future)]
306307
let _ = emitter.emit(event());
307308
}
308309
}

src/sdam/topology.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,7 @@ impl TopologyWorker {
719719

720720
fn emit_event(&self, make_event: impl FnOnce() -> SdamEvent) {
721721
if let Some(ref emitter) = self.event_emitter {
722+
#[allow(clippy::let_underscore_future)]
722723
let _ = emitter.emit(make_event());
723724
}
724725
}

src/test/csfle.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ async fn custom_key_material() -> Result<()> {
203203

204204
let key = base64::decode(
205205
"xPTAjBRG5JiPm+d3fj6XLi2q5DMXUS/f1f+SMAlhhwkhDRL0kr8r9GDLIGTAGlvC+HVjSIgdL+RKw\
206-
ZCvpXSyxTICWSXTUYsWYPyu3IoHbuBZdmw2faM3WhcRIgbMReU5").unwrap();
206+
ZCvpXSyxTICWSXTUYsWYPyu3IoHbuBZdmw2faM3WhcRIgbMReU5",
207+
)
208+
.unwrap();
207209
let id = enc
208210
.create_data_key(MasterKey::Local)
209211
.key_material(key)

0 commit comments

Comments
 (0)