Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
hbierlee committed Jan 14, 2025
1 parent 5115a9f commit 1cd574e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion crates/pindakaas/src/integer/dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub struct DomIterator<'a> {
range: RangeInclusive<Coeff>,
}

impl<'a> Iterator for DomIterator<'a> {
impl Iterator for DomIterator<'_> {
type Item = Coeff;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 2 additions & 2 deletions crates/pindakaas/src/integer/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ Actual assignments:
return vec![FxHashMap::default()];
}

return var_encs
var_encs
.iter()
// .chain((*TEST_CUTOFF).map(|e| IntVarEnc:)
.map(|enc| {
Expand All @@ -1310,7 +1310,7 @@ Actual assignments:
.collect::<FxHashMap<_, _>>()
})
.filter(|encs| !encs.is_empty())
.collect();
.collect()

/*
// TODO Comprehensive mixed encoding testing. Working but disabled for now
Expand Down
4 changes: 2 additions & 2 deletions crates/pindakaas/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ impl Display for Cnf {
}
}

impl<'a> ExactSizeIterator for CnfIterator<'a> {}
impl ExactSizeIterator for CnfIterator<'_> {}

impl<'a> Iterator for CnfIterator<'a> {
type Item = &'a [Lit];
Expand Down Expand Up @@ -672,7 +672,7 @@ impl<'a, DB: ClauseDatabase + ?Sized> ConditionalDatabase<'a, DB> {
}
}

impl<'a, DB: ClauseDatabase + ?Sized> ClauseDatabase for ConditionalDatabase<'a, DB> {
impl<DB: ClauseDatabase + ?Sized> ClauseDatabase for ConditionalDatabase<'_, DB> {
type CondDB = DB;

fn add_clause<I: IntoIterator<Item = Lit>>(&mut self, cl: I) -> Result {
Expand Down
12 changes: 6 additions & 6 deletions crates/pindakaas/src/solver/libloading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl<'lib> IpasirSolver<'lib> {
}
}

impl<'lib> ClauseDatabase for IpasirSolver<'lib> {
impl ClauseDatabase for IpasirSolver<'_> {
type CondDB = Self;

fn add_clause<I: IntoIterator<Item = Lit>>(&mut self, clause: I) -> Result {
Expand Down Expand Up @@ -255,14 +255,14 @@ impl<'lib> ClauseDatabase for IpasirSolver<'lib> {
}
}

impl<'lib> Drop for IpasirSolver<'lib> {
impl Drop for IpasirSolver<'_> {
fn drop(&mut self) {
// Release the solver.
(self.release_fn)(self.slv);
}
}

impl<'lib> LearnCallback for IpasirSolver<'lib> {
impl LearnCallback for IpasirSolver<'_> {
fn set_learn_callback<F: FnMut(&mut dyn Iterator<Item = Lit>) + 'static>(
&mut self,
cb: Option<F>,
Expand All @@ -284,7 +284,7 @@ impl<'lib> LearnCallback for IpasirSolver<'lib> {
}
}

impl<'lib> SolveAssuming for IpasirSolver<'lib> {
impl SolveAssuming for IpasirSolver<'_> {
#[allow(
refining_impl_trait,
reason = "user can use more specific type if needed"
Expand All @@ -300,7 +300,7 @@ impl<'lib> SolveAssuming for IpasirSolver<'lib> {
}
}

impl<'lib> Solver for IpasirSolver<'lib> {
impl Solver for IpasirSolver<'_> {
fn signature(&self) -> &str {
// SAFETY: We assume that the signature function as part of the IPASIR
// interface returns a valid C string.
Expand All @@ -326,7 +326,7 @@ impl<'lib> Solver for IpasirSolver<'lib> {
}
}

impl<'lib> TermCallback for IpasirSolver<'lib> {
impl TermCallback for IpasirSolver<'_> {
fn set_terminate_callback<F: FnMut() -> SlvTermSignal + 'static>(&mut self, cb: Option<F>) {
if let Some(mut cb) = cb {
let wrapped_cb = move || -> c_int {
Expand Down

0 comments on commit 1cd574e

Please sign in to comment.