Upgrades Clippy lints following Rust 1.45 release

pull/43/head
Tpt 4 years ago
parent 7e865fc30e
commit fe92703242
  1. 6
      lib/src/lib.rs
  2. 2
      lib/src/store/memory.rs
  3. 2
      lib/src/store/rocksdb.rs

@ -59,7 +59,7 @@
clippy::decimal_literal_representation, clippy::decimal_literal_representation,
//TODO clippy::doc_markdown, //TODO clippy::doc_markdown,
clippy::empty_enum, clippy::empty_enum,
clippy::option_expect_used, clippy::expect_used,
clippy::expl_impl_clone_on_copy, clippy::expl_impl_clone_on_copy,
clippy::explicit_into_iter_loop, clippy::explicit_into_iter_loop,
clippy::explicit_iter_loop, clippy::explicit_iter_loop,
@ -73,6 +73,7 @@
clippy::invalid_upcast_comparisons, clippy::invalid_upcast_comparisons,
clippy::items_after_statements, clippy::items_after_statements,
clippy::map_flatten, clippy::map_flatten,
clippy::map_unwrap_or,
//TODO clippy::match_same_arms, //TODO clippy::match_same_arms,
clippy::maybe_infinite_iter, clippy::maybe_infinite_iter,
clippy::mem_forget, clippy::mem_forget,
@ -83,14 +84,11 @@
clippy::needless_continue, clippy::needless_continue,
clippy::needless_pass_by_value, clippy::needless_pass_by_value,
clippy::non_ascii_literal, clippy::non_ascii_literal,
clippy::option_map_unwrap_or,
clippy::option_map_unwrap_or_else,
// clippy::panic, does not work well with tests // clippy::panic, does not work well with tests
clippy::path_buf_push_overwrite, clippy::path_buf_push_overwrite,
clippy::print_stdout, clippy::print_stdout,
clippy::pub_enum_variant_names, clippy::pub_enum_variant_names,
//TODO clippy::redundant_closure_for_method_calls, //TODO clippy::redundant_closure_for_method_calls,
clippy::result_map_unwrap_or_else,
// clippy::shadow_reuse, // clippy::shadow_reuse,
// clippy::shadow_same, // clippy::shadow_same,
// clippy::shadow_unrelated, // clippy::shadow_unrelated,

@ -309,12 +309,14 @@ impl MemoryStore {
iso_canonicalize(self) == iso_canonicalize(other) iso_canonicalize(self) == iso_canonicalize(other)
} }
#[allow(clippy::expect_used)]
fn indexes(&self) -> RwLockReadGuard<'_, MemoryStoreIndexes> { fn indexes(&self) -> RwLockReadGuard<'_, MemoryStoreIndexes> {
self.indexes self.indexes
.read() .read()
.expect("the Memory store mutex has been poisoned because of a panic") .expect("the Memory store mutex has been poisoned because of a panic")
} }
#[allow(clippy::expect_used)]
fn indexes_mut(&self) -> RwLockWriteGuard<'_, MemoryStoreIndexes> { fn indexes_mut(&self) -> RwLockWriteGuard<'_, MemoryStoreIndexes> {
self.indexes self.indexes
.write() .write()

@ -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 { fn get_cf<'a>(db: &'a DB, name: &str) -> &'a ColumnFamily {
db.cf_handle(name) db.cf_handle(name)
.expect("A column family that should exist in RocksDB does not exist") .expect("A column family that should exist in RocksDB does not exist")

Loading…
Cancel
Save