diff --git a/src/lib.rs b/src/lib.rs index e3fdded..eed6db3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -244,7 +244,11 @@ #![forbid(unsafe_code)] #![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo)] -#![allow(clippy::module_name_repetitions)] +#![allow( + clippy::empty_line_after_doc_comments, + clippy::module_name_repetitions, + clippy::too_long_first_doc_paragraph +)] #![doc(html_favicon_url = "https://www.arkiteq.ca/crates/indicium/icon.png")] #![doc(html_logo_url = "https://www.arkiteq.ca/crates/indicium/logo.png")] diff --git a/src/simple/internal/fuzzy_top_scores/find_bottom.rs b/src/simple/internal/fuzzy_top_scores/find_bottom.rs index 06d584c..f0eceec 100644 --- a/src/simple/internal/fuzzy_top_scores/find_bottom.rs +++ b/src/simple/internal/fuzzy_top_scores/find_bottom.rs @@ -3,7 +3,7 @@ use std::hash::Hash; // ----------------------------------------------------------------------------- -impl<'a, K: Hash + Ord, S: Clone + PartialOrd> FuzzyTopScores<'a, K, S> { +impl FuzzyTopScores<'_, K, S> { // ------------------------------------------------------------------------- // /// Finds and caches the lowest (or bottom) top score. diff --git a/src/simple/internal/fuzzy_top_scores/remove_bottom.rs b/src/simple/internal/fuzzy_top_scores/remove_bottom.rs index df4fb42..387c2fb 100644 --- a/src/simple/internal/fuzzy_top_scores/remove_bottom.rs +++ b/src/simple/internal/fuzzy_top_scores/remove_bottom.rs @@ -3,7 +3,7 @@ use std::hash::Hash; // ----------------------------------------------------------------------------- -impl<'a, K: Hash + Ord, S: PartialOrd> FuzzyTopScores<'a, K, S> { +impl FuzzyTopScores<'_, K, S> { // ------------------------------------------------------------------------- // /// Removes the lowest top score from the list. This is normally done before diff --git a/src/simple/internal/fuzzy_top_scores/with_capacity.rs b/src/simple/internal/fuzzy_top_scores/with_capacity.rs index 72adf76..16a5f9d 100644 --- a/src/simple/internal/fuzzy_top_scores/with_capacity.rs +++ b/src/simple/internal/fuzzy_top_scores/with_capacity.rs @@ -12,7 +12,7 @@ use std::hash::Hash; // ----------------------------------------------------------------------------- -impl<'a, K: Hash + Ord, S: PartialOrd> FuzzyTopScores<'a, K, S> { +impl FuzzyTopScores<'_, K, S> { // ------------------------------------------------------------------------- #![allow(clippy::default_trait_access)] /// Instantiates a new "top scores" struct with the caller provided diff --git a/src/simple/internal/search_top_scores/find_bottom.rs b/src/simple/internal/search_top_scores/find_bottom.rs index 015222c..c448293 100644 --- a/src/simple/internal/search_top_scores/find_bottom.rs +++ b/src/simple/internal/search_top_scores/find_bottom.rs @@ -3,7 +3,7 @@ use std::hash::Hash; // ----------------------------------------------------------------------------- -impl<'a, K: Hash + Ord> SearchTopScores<'a, K> { +impl SearchTopScores<'_, K> { // ------------------------------------------------------------------------- // /// Finds and caches the lowest (or bottom) top score. diff --git a/src/simple/internal/search_top_scores/remove_bottom.rs b/src/simple/internal/search_top_scores/remove_bottom.rs index 9012996..ccb1a50 100644 --- a/src/simple/internal/search_top_scores/remove_bottom.rs +++ b/src/simple/internal/search_top_scores/remove_bottom.rs @@ -3,7 +3,7 @@ use std::hash::Hash; // ----------------------------------------------------------------------------- -impl<'a, K: Hash + Ord> SearchTopScores<'a, K> { +impl SearchTopScores<'_, K> { // ------------------------------------------------------------------------- // /// Removes the lowest top score from the list. This is normally done before diff --git a/src/simple/internal/search_top_scores/with_capacity.rs b/src/simple/internal/search_top_scores/with_capacity.rs index 774ee71..bc7afaa 100644 --- a/src/simple/internal/search_top_scores/with_capacity.rs +++ b/src/simple/internal/search_top_scores/with_capacity.rs @@ -12,7 +12,7 @@ use std::hash::Hash; // ----------------------------------------------------------------------------- -impl<'a, K: Hash + Ord> SearchTopScores<'a, K> { +impl SearchTopScores<'_, K> { // ------------------------------------------------------------------------- #![allow(clippy::default_trait_access)] /// Instantiates a new "top scores" struct with the caller provided diff --git a/src/simple/internal/string_keywords.rs b/src/simple/internal/string_keywords.rs index c79336b..1763d8c 100644 --- a/src/simple/internal/string_keywords.rs +++ b/src/simple/internal/string_keywords.rs @@ -23,7 +23,7 @@ pub enum SplitContext { /// keywords. If it is, function will return `true`. If there are no excluded /// keywords, function will always return `false`. -pub fn exclude_keyword(keyword: &str, exclude_keywords: &Option>) -> bool { +pub fn exclude_keyword(keyword: &str, exclude_keywords: Option<&Vec>) -> bool { // Check to see if there's any keywords in the exclusion list: exclude_keywords.as_ref().map_or(false, |exclude_keywords| { exclude_keywords @@ -46,9 +46,9 @@ fn test_exclude_keyword() { "fall’n".into(), ]); // vec! - assert!(exclude_keyword("arise", &excluded_keywords)); + assert!(exclude_keyword("arise", excluded_keywords.as_ref())); - assert!(!exclude_keyword("arose", &excluded_keywords)); + assert!(!exclude_keyword("arose", excluded_keywords.as_ref())); } // ----------------------------------------------------------------------------- @@ -89,7 +89,7 @@ impl SearchIndex { && chars <= self.maximum_keyword_length }) // filter // Only keep the keyword if it's not in the exclusion list: - .filter(|keyword| !exclude_keyword(keyword, &self.exclude_keywords)) // filter + .filter(|keyword| !exclude_keyword(keyword, self.exclude_keywords.as_ref())) // filter // Copy string from reference: .map(KString::from_ref) // Collect all keywords into a `Vec`: @@ -124,7 +124,7 @@ impl SearchIndex { if context == &SplitContext::Indexing && chars >= self.minimum_keyword_length && chars <= maximum_string_length - && !exclude_keyword(&string, &self.exclude_keywords) + && !exclude_keyword(&string, self.exclude_keywords.as_ref()) { // Add field text / entire string to the keyword `Vec`: keywords.push(string);