Skip to content

Commit 577345c

Browse files
authored
minor: clean up clippy warnings (#559)
1 parent 7248837 commit 577345c

File tree

7 files changed

+5
-17
lines changed

7 files changed

+5
-17
lines changed

src/client/session/test/causal_consistency.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ async fn read_includes_after_cluster_time() {
297297
/// Test 5 from the causal consistency specification.
298298
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
299299
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
300-
#[function_name::named]
301300
async fn find_after_write_includes_after_cluster_time() {
302301
let _guard: RwLockReadGuard<()> = LOCK.run_concurrently().await;
303302

@@ -340,7 +339,6 @@ async fn find_after_write_includes_after_cluster_time() {
340339
/// Test 6 from the causal consistency specification.
341340
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
342341
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
343-
#[function_name::named]
344342
async fn not_causally_consistent_omits_after_cluster_time() {
345343
let _guard: RwLockReadGuard<()> = LOCK.run_concurrently().await;
346344

@@ -379,7 +377,6 @@ async fn not_causally_consistent_omits_after_cluster_time() {
379377
/// Test 7 from the causal consistency specification.
380378
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
381379
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
382-
#[function_name::named]
383380
async fn omit_after_cluster_time_standalone() {
384381
let _guard: RwLockReadGuard<()> = LOCK.run_concurrently().await;
385382

@@ -415,7 +412,6 @@ async fn omit_after_cluster_time_standalone() {
415412
/// Test 8 from the causal consistency specification.
416413
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
417414
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
418-
#[function_name::named]
419415
async fn omit_default_read_concern_level() {
420416
let _guard: RwLockReadGuard<()> = LOCK.run_concurrently().await;
421417

src/compression/test.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ fn test_snappy_compressor() {
6868
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
6969
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
7070
#[cfg(feature = "zlib-compression")]
71-
#[function_name::named]
7271
async fn ping_server_with_zlib_compression() {
7372
let mut client_options = CLIENT_OPTIONS.clone();
7473
client_options.compressors = Some(vec![Compressor::Zlib { level: Some(4) }]);
@@ -78,7 +77,6 @@ async fn ping_server_with_zlib_compression() {
7877
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
7978
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
8079
#[cfg(feature = "zstd-compression")]
81-
#[function_name::named]
8280
async fn ping_server_with_zstd_compression() {
8381
let mut client_options = CLIENT_OPTIONS.clone();
8482
client_options.compressors = Some(vec![Compressor::Zstd { level: None }]);
@@ -88,7 +86,6 @@ async fn ping_server_with_zstd_compression() {
8886
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
8987
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
9088
#[cfg(feature = "snappy-compression")]
91-
#[function_name::named]
9289
async fn ping_server_with_snappy_compression() {
9390
let mut client_options = CLIENT_OPTIONS.clone();
9491
client_options.compressors = Some(vec![Compressor::Snappy]);
@@ -102,7 +99,6 @@ async fn ping_server_with_snappy_compression() {
10299
feature = "zlib-compression",
103100
feature = "snappy-compression"
104101
))]
105-
#[function_name::named]
106102
async fn ping_server_with_all_compressors() {
107103
let mut client_options = CLIENT_OPTIONS.clone();
108104
client_options.compressors = Some(vec![

src/index/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl IndexModel {
3535
let key_names: Vec<String> = self
3636
.keys
3737
.iter()
38-
.map(|(k, v)| format!("{}_{}", k, v.to_string()))
38+
.map(|(k, v)| format!("{}_{}", k, v))
3939
.collect();
4040
self.options.get_or_insert(IndexOptions::default()).name = Some(key_names.join("_"));
4141
}

src/runtime/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl AsyncStream {
153153
let host = options.address.host();
154154
let name =
155155
DNSNameRef::try_from_ascii_str(host).map_err(|e| ErrorKind::DnsResolve {
156-
message: format!("could not resolve {:?}: {}", host, e.to_string()),
156+
message: format!("could not resolve {:?}: {}", host, e),
157157
})?;
158158
let mut tls_config = cfg.into_rustls_config()?;
159159
tls_config.enable_sni = true;

src/sync/test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ fn client() {
7676
}
7777

7878
#[test]
79-
#[function_name::named]
8079
fn default_database() {
8180
// here we just test default database name matched, the database interactive logic
8281
// is tested in `database`.

src/test/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,6 @@ async fn x509_auth() {
614614

615615
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
616616
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
617-
#[function_name::named]
618617
async fn plain_auth() {
619618
let _guard: RwLockReadGuard<_> = LOCK.run_concurrently().await;
620619

src/test/spec/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,12 @@ where
9999
let json: Value = serde_json::from_reader(File::open(path.as_path()).unwrap()).unwrap();
100100

101101
// Printing the name of the test file makes it easier to debug deserialization errors.
102-
println!("Running tests from {}", path.display().to_string());
102+
println!("Running tests from {}", path.display());
103103

104104
run_test_file(
105105
path.clone(),
106-
bson::from_bson(
107-
Bson::try_from(json).unwrap_or_else(|_| panic!("{}", path.display().to_string())),
108-
)
109-
.unwrap_or_else(|e| panic!("{}: {}", path.display().to_string(), e)),
106+
bson::from_bson(Bson::try_from(json).unwrap_or_else(|_| panic!("{}", path.display())))
107+
.unwrap_or_else(|e| panic!("{}: {}", path.display(), e)),
110108
)
111109
.await
112110
}

0 commit comments

Comments
 (0)