From ea8e6d7b1d08820cb0d22fdd819a64b2b6f08f3d Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 26 Sep 2022 07:37:55 +0700 Subject: [PATCH] Tidy up clippy config. (#1547) * Checking cfg_attr is no longer necessary. * Don't need multiple `clippy::` prefixes on a name. --- src/core/inverted_index_reader.rs | 2 +- src/indexer/delete_queue.rs | 2 +- src/postings/mod.rs | 2 +- src/termdict/fst_termdict/streamer.rs | 2 +- src/termdict/sstable_termdict/streamer.rs | 2 +- src/termdict/sstable_termdict/termdict.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/inverted_index_reader.rs b/src/core/inverted_index_reader.rs index c25061f57..db998a546 100644 --- a/src/core/inverted_index_reader.rs +++ b/src/core/inverted_index_reader.rs @@ -30,7 +30,7 @@ pub struct InvertedIndexReader { } impl InvertedIndexReader { - #[cfg_attr(feature = "cargo-clippy", allow(clippy::needless_pass_by_value))] // for symmetry + #[allow(clippy::needless_pass_by_value)] // for symmetry pub(crate) fn new( termdict: TermDictionary, postings_file_slice: FileSlice, diff --git a/src/indexer/delete_queue.rs b/src/indexer/delete_queue.rs index 433f9639f..cfac8e479 100644 --- a/src/indexer/delete_queue.rs +++ b/src/indexer/delete_queue.rs @@ -188,7 +188,7 @@ impl DeleteCursor { } } - #[cfg_attr(feature = "cargo-clippy", allow(clippy::wrong_self_convention))] + #[allow(clippy::wrong_self_convention)] fn is_behind_opstamp(&mut self, target_opstamp: Opstamp) -> bool { self.get() .map(|operation| operation.opstamp < target_opstamp) diff --git a/src/postings/mod.rs b/src/postings/mod.rs index 347605f1d..fe42cbff6 100644 --- a/src/postings/mod.rs +++ b/src/postings/mod.rs @@ -31,7 +31,7 @@ pub use self::term_info::TermInfo; pub(crate) type UnorderedTermId = u64; -#[cfg_attr(feature = "cargo-clippy", allow(clippy::enum_variant_names))] +#[allow(clippy::enum_variant_names)] #[derive(Debug, PartialEq, Clone, Copy, Eq)] pub(crate) enum FreqReadingOption { NoFreq, diff --git a/src/termdict/fst_termdict/streamer.rs b/src/termdict/fst_termdict/streamer.rs index 978ab5e0d..90d3c5ce8 100644 --- a/src/termdict/fst_termdict/streamer.rs +++ b/src/termdict/fst_termdict/streamer.rs @@ -136,7 +136,7 @@ where A: Automaton } /// Return the next `(key, value)` pair. - #[cfg_attr(feature = "cargo-clippy", allow(clippy::should_implement_trait))] + #[allow(clippy::should_implement_trait)] pub fn next(&mut self) -> Option<(&[u8], &TermInfo)> { if self.advance() { Some((self.key(), self.value())) diff --git a/src/termdict/sstable_termdict/streamer.rs b/src/termdict/sstable_termdict/streamer.rs index c755a439f..ef388dc17 100644 --- a/src/termdict/sstable_termdict/streamer.rs +++ b/src/termdict/sstable_termdict/streamer.rs @@ -179,7 +179,7 @@ where } /// Return the next `(key, value)` pair. - #[cfg_attr(feature = "cargo-clippy", allow(clippy::should_implement_trait))] + #[allow(clippy::should_implement_trait)] pub fn next(&mut self) -> Option<(&[u8], &TermInfo)> { if self.advance() { Some((self.key(), self.value())) diff --git a/src/termdict/sstable_termdict/termdict.rs b/src/termdict/sstable_termdict/termdict.rs index fb370e4aa..0b93fc738 100644 --- a/src/termdict/sstable_termdict/termdict.rs +++ b/src/termdict/sstable_termdict/termdict.rs @@ -52,7 +52,7 @@ impl TermDictionaryBuilder { /// to insert_key and insert_value. /// /// Prefer using `.insert(key, value)` - #[allow(clippy::clippy::clippy::unnecessary_wraps)] + #[allow(clippy::unnecessary_wraps)] pub(crate) fn insert_key(&mut self, key: &[u8]) -> io::Result<()> { self.sstable_writer.write_key(key); Ok(())