Skip to content

Commit 9432248

Browse files
committed
chore: update itertools from 0.14 to 0.15
1 parent 0cc83f2 commit 9432248

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

crates/pindakaas/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ readme = "../../README.md"
1717
all-features = true
1818

1919
[dependencies]
20-
itertools = "0.14"
20+
itertools = "0.15"
2121
rustc-hash = "2.0"
2222
rangelist = "0.5.0"
2323

crates/pindakaas/src/cardinality_one.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<Db: ClauseDatabase + ?Sized> Encoder<Db, CardinalityOne> for PairwiseEncode
154154
at_least_one_clause(db, card1)?;
155155
}
156156
// For every pair of literals (i, j) add "¬i ∨ ¬j"
157-
for (a, b) in card1.lits.iter().copied().tuple_combinations() {
157+
for [a, b] in card1.lits.iter().copied().array_combinations() {
158158
db.add_clause([!a, !b])?;
159159
}
160160
Ok(())

crates/pindakaas/src/propositional_logic.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::{
1111
ops::{BitAnd, BitOr, BitXor, Not},
1212
};
1313

14-
use itertools::{Itertools, Position};
14+
use itertools::Itertools;
1515
use rustc_hash::FxHashSet;
1616

1717
use crate::{BoolVal, ClauseDatabase, ClauseDatabaseTools, Cnf, Encoder, Lit, Result};
@@ -382,10 +382,10 @@ impl Formula<Lit> {
382382

383383
let mut left = lits.pop().unwrap();
384384
for (pos, right) in lits.into_iter().with_position() {
385-
let new_name = match pos {
386-
Position::Last | Position::Only => name,
387-
_ => db.new_var().into(),
388-
};
385+
let new_name = pos
386+
.is_first()
387+
.then(|| name)
388+
.unwrap_or_else(|| db.new_var().into());
389389
// new_name -> (left xor right)
390390
db.add_clause([!new_name, !left, !right])?;
391391
db.add_clause([!new_name, left, right])?;

crates/pyndakaas/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ name = "pindakaas"
1616
crate-type = ["cdylib"]
1717

1818
[dependencies]
19-
itertools = "0.14"
19+
itertools = "0.15"
2020
pindakaas = { version = "0.5.1", path = "../pindakaas", features = ["kissat"] }
2121
pyo3 = "0.28.3"
2222

0 commit comments

Comments
 (0)