Skip to content

Commit a6f152e

Browse files
authored
minor: fix clippy for 1.52.0 (#335)
1 parent c219c18 commit a6f152e

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/client/options/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ impl ClientOptionsParser {
11031103
None
11041104
} else {
11051105
let port_string_without_colon = &port[1..];
1106-
let p = u16::from_str_radix(port_string_without_colon, 10).map_err(|_| {
1106+
let p: u16 = port_string_without_colon.parse().map_err(|_| {
11071107
ErrorKind::ArgumentError {
11081108
message: format!(
11091109
"invalid port specified in connection string: {}",
@@ -1348,7 +1348,7 @@ impl ClientOptionsParser {
13481348

13491349
macro_rules! get_duration {
13501350
($value:expr, $option:expr) => {
1351-
match u64::from_str_radix($value, 10) {
1351+
match $value.parse::<u64>() {
13521352
Ok(i) => i,
13531353
_ => {
13541354
return Err(ErrorKind::ArgumentError {
@@ -1365,7 +1365,7 @@ impl ClientOptionsParser {
13651365

13661366
macro_rules! get_u32 {
13671367
($value:expr, $option:expr) => {
1368-
match u32::from_str_radix(value, 10) {
1368+
match value.parse::<u32>() {
13691369
Ok(u) => u,
13701370
Err(_) => {
13711371
return Err(ErrorKind::ArgumentError {
@@ -1382,7 +1382,7 @@ impl ClientOptionsParser {
13821382

13831383
macro_rules! get_i32 {
13841384
($value:expr, $option:expr) => {
1385-
match i32::from_str_radix(value, 10) {
1385+
match value.parse::<i32>() {
13861386
Ok(u) => u,
13871387
Err(_) => {
13881388
return Err(ErrorKind::ArgumentError {
@@ -1654,7 +1654,7 @@ impl ClientOptionsParser {
16541654
"w" => {
16551655
let mut write_concern = self.write_concern.get_or_insert_with(Default::default);
16561656

1657-
match i32::from_str_radix(value, 10) {
1657+
match value.parse::<i32>() {
16581658
Ok(w) => match u32::try_from(w) {
16591659
Ok(uw) => write_concern.w = Some(Acknowledgment::from(uw)),
16601660
Err(_) => {

src/cmap/establish/handshake/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ impl Handshaker {
224224
});
225225

226226
Ok(HandshakeResult {
227-
first_round,
228227
is_master_reply,
228+
first_round,
229229
})
230230
}
231231
}

src/cmap/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ impl ConnectionPool {
8686
address,
8787
manager,
8888
connection_requester,
89+
generation_subscriber,
8990
wait_queue_timeout,
9091
event_handler,
91-
generation_subscriber,
9292
}
9393
}
9494

src/coll/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ pub struct FindOneAndUpdateOptions {
412412
/// Specifies the options to a [`Collection::aggregate`](../struct.Collection.html#method.aggregate)
413413
/// operation.
414414
#[skip_serializing_none]
415-
#[serde(rename_all = "camelCase")]
416415
#[derive(Clone, Debug, Default, Deserialize, TypedBuilder, Serialize)]
416+
#[serde(rename_all = "camelCase")]
417417
#[builder(field_defaults(default, setter(strip_option)))]
418418
#[non_exhaustive]
419419
pub struct AggregateOptions {

src/test/util/matchable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub trait Matchable: Sized + 'static {
1717
if expected.is_placeholder() {
1818
return true;
1919
}
20-
if let Some(expected) = Any::downcast_ref::<Self>(expected) {
20+
if let Some(expected) = <dyn Any>::downcast_ref::<Self>(expected) {
2121
self.content_matches(expected)
2222
} else {
2323
false

0 commit comments

Comments
 (0)