Skip to content

Commit

Permalink
chore: applied clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
leontoeides committed Sep 21, 2024
1 parent cde0210 commit ae9ff66
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 90 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ Cargo.lock
**/*.rs.bk
>>>>>>> 5b80c372faafec53fa73cd79d3c44af6183c5d5e
>>>>>>> 0724576... Inital commit.
/mutants.out/
/mutants.out/
/fuzz
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "indicium"
version = "0.6.2"
version = "0.6.3"
authors = ["Dylan Bowker <[email protected]>"]
edition = "2021"
categories = [ "database-implementations" ]
Expand All @@ -26,7 +26,7 @@ strsim = [ "dep:strsim" ]
[dependencies]
ahash = { version = "0.8", optional = true }
eddie = { version = "0.4", optional = true }
gxhash = { version = "3.1", optional = true }
gxhash = { version = "3.4", optional = true }
kstring = "2.0"
serde = { version = "1.0", features = [ "derive" ], optional = true }
strsim = { version = "0.11", optional = true }
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
//! # What's New?
//!
//! * Release notes are available on
//! [GitHub](https://github.com/leontoeides/indicium/releases).
//! [GitHub](https://github.com/leontoeides/indicium/releases).
//!
//! * The full [change
//! log](https://github.com/leontoeides/indicium/blob/master/CHANGELOG.md) is
//! available on GitHub.
//! log](https://github.com/leontoeides/indicium/blob/master/CHANGELOG.md) is
//! available on GitHub.
//!
//! # Quick Start Guide
//!
Expand Down
14 changes: 7 additions & 7 deletions src/simple/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,17 @@ impl<K: Clone + Ord> SearchIndexBuilder<K> {
/// | 3 | Pseudopseudohypoparathyroidism | 0 | |
///
/// * In example **1**, since the length is set to `2`, the user's keyword
/// will only be fuzzy matched against keywords in the search index that
/// begin with `su`.
/// will only be fuzzy matched against keywords in the search index that
/// begin with `su`.
///
/// * In example **2**, since the length is set to `4`, the user's keyword
/// will only be fuzzy matched against keywords in the search index that
/// begin with `anti`.
/// will only be fuzzy matched against keywords in the search index that
/// begin with `anti`.
///
/// * In example **3**, since the length is set to `0`, the user's keyword
/// will be fuzzy matched against every keyword in the search index. This is
/// OK (or even desirable) if the search index is small, however, this will
/// be crippling slow on very large search indicies.
/// will be fuzzy matched against every keyword in the search index. This
/// is OK (or even desirable) if the search index is small, however, this
/// will be crippling slow on very large search indicies.
///
/// **Default:** `3` characters
#[cfg(any(feature = "eddie", feature = "strsim"))]
Expand Down
12 changes: 6 additions & 6 deletions src/simple/indexable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
/// ```
///
/// * Note: Don't forget that you may make numbers, numeric identifiers, enums,
/// and other types in your `struct` (or other complex types) indexable by
/// converting them to a `String` and including them in the returned
/// `Vec<String>`.
/// and other types in your `struct` (or other complex types) indexable by
/// converting them to a `String` and including them in the returned
/// `Vec<String>`.
///
/// * Note: Any type that implements `ToString` (and consequently any type that
/// implements `Display`) to, in turn, gets the `Indexable` implementation for
/// free. This includes Rust primitives like `String`, `u8`, `u16`, `u32`,
/// `u64`, `i8`, `i16`, `i32`, `i64` and so on...
/// implements `Display`) to, in turn, gets the `Indexable` implementation for
/// free. This includes Rust primitives like `String`, `u8`, `u16`, `u32`,
/// `u64`, `i8`, `i16`, `i32`, `i64` and so on...
///
/// #### Pro-Tip: Hash Tags
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
///
/// * `key_set` limits which keywords to compare the user's keyword
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
14 changes: 7 additions & 7 deletions src/simple/internal/strsim/autocomplete/context_jaro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
///
/// * `key_set` limits which keywords to compare the user's keyword
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
14 changes: 7 additions & 7 deletions src/simple/internal/strsim/autocomplete/context_jaro_winkler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
///
/// * `key_set` limits which keywords to compare the user's keyword
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
14 changes: 7 additions & 7 deletions src/simple/internal/strsim/autocomplete/context_levenshtein.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
///
/// * `key_set` limits which keywords to compare the user's keyword
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
14 changes: 7 additions & 7 deletions src/simple/internal/strsim/autocomplete/context_sorensen_dice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
///
/// * `key_set` limits which keywords to compare the user's keyword
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
/// against. For a search index keyword to be considered as a fuzzy match,
/// it must contain at least one key that is in this key set. This is how
/// fuzzy matching is made contextual.
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
8 changes: 4 additions & 4 deletions src/simple/internal/strsim/autocomplete/global_jaro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
8 changes: 4 additions & 4 deletions src/simple/internal/strsim/autocomplete/global_levenshtein.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ impl<K: Hash + Ord> SearchIndex<K> {
/// find the best match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
//
// Note: these `strsim_autocomplete_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
8 changes: 4 additions & 4 deletions src/simple/internal/strsim/keyword/global_jaro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ impl<K: Ord> SearchIndex<K> {
/// match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
//
// Note: these `strsim_keyword_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
8 changes: 4 additions & 4 deletions src/simple/internal/strsim/keyword/global_jaro_winkler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ impl<K: Ord> SearchIndex<K> {
/// match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
//
// Note: these `strsim_keyword_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
8 changes: 4 additions & 4 deletions src/simple/internal/strsim/keyword/global_levenshtein.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ impl<K: Ord> SearchIndex<K> {
/// match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
//
// Note: these `strsim_keyword_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down
8 changes: 4 additions & 4 deletions src/simple/internal/strsim/keyword/global_sorensen_dice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ impl<K: Ord> SearchIndex<K> {
/// match for substitution.
///
/// * `index_range` limits which keywords to compare the user's keyword
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
/// against. For example, if the `index_range` is "super" and the user's
/// keyword is "supersonic": only search index keywords beginning with
/// "super" will be compared against the user's keyword: "supersonic"
/// against "superalloy", "supersonic" against "supergiant" and so on...
//
// Note: these `strsim_keyword_*` methods are very similar and may seem
// repetitive with a lot of boiler plate. These were intentionally made more
Expand Down

0 comments on commit ae9ff66

Please sign in to comment.