From fe9270324292bd0cf5bd1464f1e76ab7ccfcf8c3 Mon Sep 17 00:00:00 2001 From: Tpt Date: Sat, 18 Jul 2020 19:03:51 +0200 Subject: [PATCH] Upgrades Clippy lints following Rust 1.45 release --- lib/src/lib.rs | 6 ++---- lib/src/store/memory.rs | 2 ++ lib/src/store/rocksdb.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 825c1473..656b676c 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -59,7 +59,7 @@ clippy::decimal_literal_representation, //TODO clippy::doc_markdown, clippy::empty_enum, - clippy::option_expect_used, + clippy::expect_used, clippy::expl_impl_clone_on_copy, clippy::explicit_into_iter_loop, clippy::explicit_iter_loop, @@ -73,6 +73,7 @@ clippy::invalid_upcast_comparisons, clippy::items_after_statements, clippy::map_flatten, + clippy::map_unwrap_or, //TODO clippy::match_same_arms, clippy::maybe_infinite_iter, clippy::mem_forget, @@ -83,14 +84,11 @@ clippy::needless_continue, clippy::needless_pass_by_value, clippy::non_ascii_literal, - clippy::option_map_unwrap_or, - clippy::option_map_unwrap_or_else, // clippy::panic, does not work well with tests clippy::path_buf_push_overwrite, clippy::print_stdout, clippy::pub_enum_variant_names, //TODO clippy::redundant_closure_for_method_calls, - clippy::result_map_unwrap_or_else, // clippy::shadow_reuse, // clippy::shadow_same, // clippy::shadow_unrelated, diff --git a/lib/src/store/memory.rs b/lib/src/store/memory.rs index cd26f8ab..7935dcbc 100644 --- a/lib/src/store/memory.rs +++ b/lib/src/store/memory.rs @@ -309,12 +309,14 @@ impl MemoryStore { iso_canonicalize(self) == iso_canonicalize(other) } + #[allow(clippy::expect_used)] fn indexes(&self) -> RwLockReadGuard<'_, MemoryStoreIndexes> { self.indexes .read() .expect("the Memory store mutex has been poisoned because of a panic") } + #[allow(clippy::expect_used)] fn indexes_mut(&self) -> RwLockWriteGuard<'_, MemoryStoreIndexes> { self.indexes .write() diff --git a/lib/src/store/rocksdb.rs b/lib/src/store/rocksdb.rs index 66efe564..b5632f99 100644 --- a/lib/src/store/rocksdb.rs +++ b/lib/src/store/rocksdb.rs @@ -687,7 +687,7 @@ impl RocksDbInnerTransaction<'_> { } } -#[allow(clippy::option_expect_used)] +#[allow(clippy::expect_used)] fn get_cf<'a>(db: &'a DB, name: &str) -> &'a ColumnFamily { db.cf_handle(name) .expect("A column family that should exist in RocksDB does not exist")