Skip to content

Commit 6b74f93

Browse files
authored
minor: remove unused variables (#206)
1 parent 6dc3028 commit 6b74f93

File tree

28 files changed

+81
-94
lines changed

28 files changed

+81
-94
lines changed

src/client/executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl Client {
119119

120120
let server = match self.select_server(op.selection_criteria()).await {
121121
Ok(server) => server,
122-
Err(err) => {
122+
Err(_) => {
123123
return Err(first_error);
124124
}
125125
};

src/client/session/test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ async fn implicit_session_returned_after_exhaust_by_get_more() {
400400
let coll = client
401401
.init_db_and_coll(function_name!(), function_name!())
402402
.await;
403-
for i in 0..5 {
403+
for _ in 0..5 {
404404
coll.insert_one(doc! {}, None)
405405
.await
406406
.expect("insert should succeed");
@@ -416,7 +416,7 @@ async fn implicit_session_returned_after_exhaust_by_get_more() {
416416
.await
417417
.expect("find should succeed");
418418

419-
for i in 0..4 {
419+
for _ in 0..4 {
420420
assert!(matches!(cursor.next().await, Some(Ok(_))));
421421
}
422422

@@ -456,7 +456,7 @@ async fn find_and_getmore_share_session() {
456456
let options = InsertOneOptions::builder()
457457
.write_concern(WriteConcern::builder().w(Acknowledgment::Majority).build())
458458
.build();
459-
for i in 0..3 {
459+
for _ in 0..3 {
460460
coll.insert_one(doc! {}, options.clone())
461461
.await
462462
.expect("insert should succeed");
@@ -489,7 +489,7 @@ async fn find_and_getmore_share_session() {
489489
.await
490490
.expect("find should succeed");
491491

492-
for i in 0..3 {
492+
for _ in 0..3 {
493493
assert!(matches!(cursor.next().await, Some(Ok(_))));
494494
}
495495

src/cmap/background.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl ConnectionPool {
6161
Ok(connection) => {
6262
connection_manager.checked_in_connections.push(connection)
6363
}
64-
e @ Err(_) => {
64+
Err(_) => {
6565
// Since we encountered an error, we return early from this function and
6666
// put the background thread back to sleep. Next time it wakes up, any
6767
// stale connections will be closed, and the thread can try to create

src/cmap/establish/handshake/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ impl Handshaker {
151151

152152
if let Some(ref mut platform) = metadata.platform {
153153
if let Some(ref driver_info_platform) = driver_info.platform {
154-
metadata.driver.version.push('|');
155-
metadata.driver.version.push_str(driver_info_platform);
154+
platform.push('|');
155+
platform.push_str(driver_info_platform);
156156
}
157157
}
158158
}

src/event/cmap.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,41 +230,41 @@ pub struct ConnectionCheckedInEvent {
230230
pub trait CmapEventHandler: Send + Sync {
231231
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
232232
/// whenever a connection pool is created.
233-
fn handle_pool_created_event(&self, event: PoolCreatedEvent) {}
233+
fn handle_pool_created_event(&self, _event: PoolCreatedEvent) {}
234234

235235
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
236236
/// whenever a connection pool is cleared.
237-
fn handle_pool_cleared_event(&self, event: PoolClearedEvent) {}
237+
fn handle_pool_cleared_event(&self, _event: PoolClearedEvent) {}
238238

239239
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
240240
/// whenever a connection pool is cleared.
241-
fn handle_pool_closed_event(&self, event: PoolClosedEvent) {}
241+
fn handle_pool_closed_event(&self, _event: PoolClosedEvent) {}
242242

243243
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
244244
/// whenever a connection is created.
245-
fn handle_connection_created_event(&self, event: ConnectionCreatedEvent) {}
245+
fn handle_connection_created_event(&self, _event: ConnectionCreatedEvent) {}
246246

247247
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
248248
/// whenever a connection is ready to be used.
249-
fn handle_connection_ready_event(&self, event: ConnectionReadyEvent) {}
249+
fn handle_connection_ready_event(&self, _event: ConnectionReadyEvent) {}
250250

251251
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
252252
/// whenever a connection is closed.
253-
fn handle_connection_closed_event(&self, event: ConnectionClosedEvent) {}
253+
fn handle_connection_closed_event(&self, _event: ConnectionClosedEvent) {}
254254

255255
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
256256
/// whenever a thread begins checking out a connection to use for an operation.
257-
fn handle_connection_checkout_started_event(&self, event: ConnectionCheckoutStartedEvent) {}
257+
fn handle_connection_checkout_started_event(&self, _event: ConnectionCheckoutStartedEvent) {}
258258

259259
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
260260
/// whenever a thread is unable to check out a connection.
261-
fn handle_connection_checkout_failed_event(&self, event: ConnectionCheckoutFailedEvent) {}
261+
fn handle_connection_checkout_failed_event(&self, _event: ConnectionCheckoutFailedEvent) {}
262262

263263
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
264264
/// whenever a connection is successfully checked out.
265-
fn handle_connection_checked_out_event(&self, event: ConnectionCheckedOutEvent) {}
265+
fn handle_connection_checked_out_event(&self, _event: ConnectionCheckedOutEvent) {}
266266

267267
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
268268
/// whenever a connection is checked back into a connection pool.
269-
fn handle_connection_checked_in_event(&self, event: ConnectionCheckedInEvent) {}
269+
fn handle_connection_checked_in_event(&self, _event: ConnectionCheckedInEvent) {}
270270
}

src/event/command.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ pub struct CommandFailedEvent {
113113
pub trait CommandEventHandler: Send + Sync {
114114
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
115115
/// whenever a database command is initiated.
116-
fn handle_command_started_event(&self, event: CommandStartedEvent) {}
116+
fn handle_command_started_event(&self, _event: CommandStartedEvent) {}
117117

118118
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
119119
/// whenever a database command successfully completes.
120-
fn handle_command_succeeded_event(&self, event: CommandSucceededEvent) {}
120+
fn handle_command_succeeded_event(&self, _event: CommandSucceededEvent) {}
121121

122122
/// A [`Client`](../../struct.Client.html) will call this method on each registered handler
123123
/// whenever a database command fails to complete successfully.
124-
fn handle_command_failed_event(&self, event: CommandFailedEvent) {}
124+
fn handle_command_failed_event(&self, _event: CommandFailedEvent) {}
125125
}

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
//! # }
7171
//! ```
7272
73-
#![allow(unused_variables)]
7473
#![cfg_attr(
7574
feature = "cargo-clippy",
7675
allow(

src/operation/aggregate/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl Operation for Aggregate {
4242
type O = CursorSpecification;
4343
const NAME: &'static str = "aggregate";
4444

45-
fn build(&self, description: &StreamDescription) -> Result<Command> {
45+
fn build(&self, _description: &StreamDescription) -> Result<Command> {
4646
let mut body = doc! {
4747
Self::NAME: self.target.to_bson(),
4848
"pipeline": bson_util::to_bson_array(&self.pipeline),

src/operation/count/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl Operation for Count {
3838
type O = i64;
3939
const NAME: &'static str = "count";
4040

41-
fn build(&self, description: &StreamDescription) -> Result<Command> {
41+
fn build(&self, _description: &StreamDescription) -> Result<Command> {
4242
let mut body: Document = doc! {
4343
Self::NAME: self.ns.coll.clone(),
4444
};

src/operation/create/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl Operation for Create {
3737
type O = ();
3838
const NAME: &'static str = "create";
3939

40-
fn build(&self, description: &StreamDescription) -> Result<Command> {
40+
fn build(&self, _description: &StreamDescription) -> Result<Command> {
4141
let mut body = doc! {
4242
Self::NAME: self.ns.coll.clone(),
4343
};

0 commit comments

Comments
 (0)