fix(naive): improve found character indexing #2
cargo devel CI / cargo CI (push) Failing after 1m53s Details

This commit is contained in:
Christoph J. Scherr 2024-07-31 11:00:45 +02:00
parent 4b7e9433b9
commit 845fd73040
1 changed files with 4 additions and 7 deletions

View File

@ -72,13 +72,10 @@ impl<'wl, WL: WordList> Solver<'wl, WL> for NaiveSolver<'wl, WL> {
already_tried.push((*spot, *other.0)); already_tried.push((*spot, *other.0));
} }
if p.0 for c in p.0.char_indices() {
.char_indices() if c.1 == *other.0 && other.1.contains(&c.0) {
.filter(|ci| ci.1 == *other.0 && !already_tried.contains(ci)) return false;
.count() }
< 1
{
return false;
} }
} else { } else {
return false; return false;