Skip to content

Commit

Permalink
Fix clippy warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekker1 committed May 6, 2024
1 parent 1e90f85 commit 3a97525
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --all-features -- -D warnings
run: cargo clippy --tests --features splr,cadical,kissat,intel-sat,ipasir-up -- -D warnings
format:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion crates/pindakaas/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ pub mod tests {
feature = "trace",
tracing::instrument(name = "negate_encoder", skip_all)
)]
fn encode<'a, DB: ClauseDatabase>(&mut self, db: &mut DB, lit: Lit) -> Result {
fn encode<DB: ClauseDatabase>(&mut self, db: &mut DB, lit: Lit) -> Result {
emit_clause!(db, [!lit])
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/pindakaas/src/solver/cadical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ mod tests {
PropagatingSolver::add_observed_var(&mut slv, v)
}

let mut solns = Vec::new();
while slv.solve(|model| {
let mut solns: Vec<Vec<Lit>> = Vec::new();
let push_sol = |model: &CadicalSol, solns: &mut Vec<Vec<Lit>>| {
let sol: Vec<Lit> = vars
.clone()
.map(|v| {
Expand All @@ -171,8 +171,8 @@ mod tests {
})
.collect_vec();
solns.push(sol);
}) == SolveResult::Sat
{
};
while slv.solve(|model| push_sol(model, &mut solns)) == SolveResult::Sat {
slv.add_clause(solns.last().unwrap().iter().map(|l| !l))
.unwrap()
}
Expand Down

0 comments on commit 3a97525

Please sign in to comment.