Skip to content

Commit

Permalink
Feature conflicts will now cause compile errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
leontoeides committed Nov 18, 2023
1 parent 6acae71 commit a1c3b87
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "indicium"
version = "0.6.0"
version = "0.6.1"
authors = ["Dylan Bowker <[email protected]>"]
edition = "2021"
categories = [ "database-implementations" ]
Expand Down
4 changes: 2 additions & 2 deletions src/simple/autocomplete/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ impl<K: Hash + Ord> SearchIndex<K> {
autocompletions = self.eddie_context_autocomplete(
&search_results,
&last_keyword,
) // strsim_context_autocomplete
) // eddie_context_autocomplete
.into_iter()
// Only keep this autocompletion if hasn't already been used
// as a keyword:
.filter(|(keyword, _keys)| !keywords.contains(keyword))
// Only return `maximum_autocomplete_options` number of
// keywords:
.take(*maximum_autocomplete_options)
// `strsim_autocomplete` returns both the keyword and keys.
// `eddie_autocomplete` returns both the keyword and keys.
// We're autocompleting the last (partial) keyword, so
// discard the keys:
.map(|(keyword, _keys)| keyword)
Expand Down
2 changes: 1 addition & 1 deletion src/simple/autocomplete/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl<K: Hash + Ord> SearchIndex<K> {
// Only return `maximum_autocomplete_options` number of
// keywords:
.take(*maximum_autocomplete_options)
// `strsim_autocomplete` returns both the keyword and keys.
// `eddie_autocomplete` returns both the keyword and keys.
// We're autocompleting the last (partial) keyword, so
// discard the keys:
.map(|(keyword, _keys)| keyword)
Expand Down
5 changes: 4 additions & 1 deletion src/simple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//! There might be more search implementations in future versions.

#[cfg(all(feature = "eddie", feature = "strsim"))]
compile_error!("feature `eddie` and `strsim` are mutually exclusive and cannot be enabled together");
compile_error!("features `eddie` (preferred) and `strsim` cannot both be enabled");

#[cfg(all(feature = "ahash", feature = "gxhash"))]
compile_error!("features `ahash` (preferred) and `gxhash` cannot both be enabled");

// Directories:
mod autocomplete;
Expand Down

0 comments on commit a1c3b87

Please sign in to comment.