diff --git a/Cargo.toml b/Cargo.toml index 3adc917..72db1b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "inquisition" -version = "0.1.0" +version = "0.0.1" authors = ["Lutetium Vanadium"] edition = "2018" @@ -11,7 +11,11 @@ members = [ ] [dependencies] -ahash = "0.7.2" +ahash = { version = "0.7.2", optional = true } crossterm = "0.19.0" tempfile = "3" ui = { path = "./ui" } + +[features] +default = ["fast-hash"] +fast-hash = ["ahash"] diff --git a/src/answer.rs b/src/answer.rs index b18b697..2973503 100644 --- a/src/answer.rs +++ b/src/answer.rs @@ -4,7 +4,10 @@ use std::{ ops::{Deref, DerefMut}, }; +#[cfg(feature = "fast-hash")] use ahash::AHashMap as HashMap; +#[cfg(not(feature = "fast-hash"))] +use std::collections::HashMap; #[derive(Debug, Clone, PartialEq, PartialOrd)] pub enum Answer { diff --git a/src/question/expand.rs b/src/question/expand.rs index 0d6cfa0..e3312f1 100644 --- a/src/question/expand.rs +++ b/src/question/expand.rs @@ -1,6 +1,10 @@ use std::fmt; +#[cfg(feature = "fast-hash")] use ahash::AHashSet as HashSet; +#[cfg(not(feature = "fast-hash"))] +use std::collections::HashSet; + use crossterm::{ cursor, queue, style::{Color, Colorize, ResetColor, SetForegroundColor},