Skip to content

Commit 0a0f82f

Browse files
authored
minor: fix clippy errors on 1.49 (#281)
1 parent d4a9559 commit 0a0f82f

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

src/client/options/mod.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,10 @@ impl ClientOptions {
681681
/// used in the SRV tests.
682682
#[cfg(test)]
683683
pub(crate) fn new_srv() -> Self {
684-
let mut options = Self::default();
685-
options.original_srv_hostname = Some("localhost.test.test.build.10gen.cc".into());
686-
options
684+
Self {
685+
original_srv_hostname: Some("localhost.test.test.build.10gen.cc".into()),
686+
..Default::default()
687+
}
687688
}
688689

689690
/// Parses a MongoDB connection string into a ClientOptions struct. If the string is malformed

src/cmap/test/integration.rs

+14-12
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,22 @@ async fn concurrent_connections() {
122122
});
123123
futures::future::join_all(tasks).await;
124124

125-
// ensure all three ConnectionCreatedEvents were emitted before one ConnectionReadyEvent.
126-
let events = handler.events.read().unwrap();
127-
let mut consecutive_creations = 0;
128-
for event in events.iter() {
129-
match event {
130-
Event::ConnectionCreated(_) => {
131-
consecutive_creations += 1;
132-
}
133-
Event::ConnectionReady(_) => {
134-
if consecutive_creations < 2 {
135-
panic!("connections not created concurrently");
125+
{
126+
// ensure all three ConnectionCreatedEvents were emitted before one ConnectionReadyEvent.
127+
let events = handler.events.read().unwrap();
128+
let mut consecutive_creations = 0;
129+
for event in events.iter() {
130+
match event {
131+
Event::ConnectionCreated(_) => {
132+
consecutive_creations += 1;
133+
}
134+
Event::ConnectionReady(_) => {
135+
if consecutive_creations < 2 {
136+
panic!("connections not created concurrently");
137+
}
136138
}
139+
_ => (),
137140
}
138-
_ => (),
139141
}
140142
}
141143

0 commit comments

Comments
 (0)