Skip to content

Commit

Permalink
minor: clean up clippy warnings (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
abr-egn authored Jan 18, 2022
1 parent 7248837 commit 577345c
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 17 deletions.
4 changes: 0 additions & 4 deletions src/client/session/test/causal_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ async fn read_includes_after_cluster_time() {
/// Test 5 from the causal consistency specification.
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
#[function_name::named]
async fn find_after_write_includes_after_cluster_time() {
let _guard: RwLockReadGuard<()> = LOCK.run_concurrently().await;

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

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

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

Expand Down
4 changes: 0 additions & 4 deletions src/compression/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fn test_snappy_compressor() {
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
#[cfg(feature = "zlib-compression")]
#[function_name::named]
async fn ping_server_with_zlib_compression() {
let mut client_options = CLIENT_OPTIONS.clone();
client_options.compressors = Some(vec![Compressor::Zlib { level: Some(4) }]);
Expand All @@ -78,7 +77,6 @@ async fn ping_server_with_zlib_compression() {
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
#[cfg(feature = "zstd-compression")]
#[function_name::named]
async fn ping_server_with_zstd_compression() {
let mut client_options = CLIENT_OPTIONS.clone();
client_options.compressors = Some(vec![Compressor::Zstd { level: None }]);
Expand All @@ -88,7 +86,6 @@ async fn ping_server_with_zstd_compression() {
#[cfg_attr(feature = "tokio-runtime", tokio::test)]
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
#[cfg(feature = "snappy-compression")]
#[function_name::named]
async fn ping_server_with_snappy_compression() {
let mut client_options = CLIENT_OPTIONS.clone();
client_options.compressors = Some(vec![Compressor::Snappy]);
Expand All @@ -102,7 +99,6 @@ async fn ping_server_with_snappy_compression() {
feature = "zlib-compression",
feature = "snappy-compression"
))]
#[function_name::named]
async fn ping_server_with_all_compressors() {
let mut client_options = CLIENT_OPTIONS.clone();
client_options.compressors = Some(vec![
Expand Down
2 changes: 1 addition & 1 deletion src/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl IndexModel {
let key_names: Vec<String> = self
.keys
.iter()
.map(|(k, v)| format!("{}_{}", k, v.to_string()))
.map(|(k, v)| format!("{}_{}", k, v))
.collect();
self.options.get_or_insert(IndexOptions::default()).name = Some(key_names.join("_"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl AsyncStream {
let host = options.address.host();
let name =
DNSNameRef::try_from_ascii_str(host).map_err(|e| ErrorKind::DnsResolve {
message: format!("could not resolve {:?}: {}", host, e.to_string()),
message: format!("could not resolve {:?}: {}", host, e),
})?;
let mut tls_config = cfg.into_rustls_config()?;
tls_config.enable_sni = true;
Expand Down
1 change: 0 additions & 1 deletion src/sync/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ fn client() {
}

#[test]
#[function_name::named]
fn default_database() {
// here we just test default database name matched, the database interactive logic
// is tested in `database`.
Expand Down
1 change: 0 additions & 1 deletion src/test/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,6 @@ async fn x509_auth() {

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

Expand Down
8 changes: 3 additions & 5 deletions src/test/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ where
let json: Value = serde_json::from_reader(File::open(path.as_path()).unwrap()).unwrap();

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

run_test_file(
path.clone(),
bson::from_bson(
Bson::try_from(json).unwrap_or_else(|_| panic!("{}", path.display().to_string())),
)
.unwrap_or_else(|e| panic!("{}: {}", path.display().to_string(), e)),
bson::from_bson(Bson::try_from(json).unwrap_or_else(|_| panic!("{}", path.display())))
.unwrap_or_else(|e| panic!("{}: {}", path.display(), e)),
)
.await
}
Expand Down

0 comments on commit 577345c

Please sign in to comment.