diff --git a/src/solve/naive/mod.rs b/src/solve/naive/mod.rs index 669e751..5548615 100644 --- a/src/solve/naive/mod.rs +++ b/src/solve/naive/mod.rs @@ -72,13 +72,10 @@ impl<'wl, WL: WordList> Solver<'wl, WL> for NaiveSolver<'wl, WL> { already_tried.push((*spot, *other.0)); } - if p.0 - .char_indices() - .filter(|ci| ci.1 == *other.0 && !already_tried.contains(ci)) - .count() - < 1 - { - return false; + for c in p.0.char_indices() { + if c.1 == *other.0 && other.1.contains(&c.0) { + return false; + } } } else { return false;