Skip to content

Commit 8ea2dd6

Browse files
committed
style: some clippy fixes
1 parent 0af19b6 commit 8ea2dd6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/state.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,10 @@ impl<M: Math, P: Point<M>> State<M, P> {
104104
impl<M: Math, P: Point<M>> Drop for State<M, P> {
105105
fn drop(&mut self) {
106106
let rc = unsafe { std::mem::ManuallyDrop::take(&mut self.inner) };
107-
if (Rc::strong_count(&rc) == 1) & (Rc::weak_count(&rc) == 0) {
108-
if let Some(storage) = rc.reuser.upgrade() {
107+
if (Rc::strong_count(&rc) == 1) & (Rc::weak_count(&rc) == 0)
108+
&& let Some(storage) = rc.reuser.upgrade() {
109109
storage.free_states.borrow_mut().push(rc);
110110
}
111-
}
112111
}
113112
}
114113

src/transform_adapt_strategy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl<M: Math> AdaptStrategy<M> for TransformAdaptation {
197197

198198
if draw < self.final_window_size {
199199
if draw < 100 {
200-
if (draw > 0) & (draw % 10 == 0) {
200+
if (draw > 0) & draw.is_multiple_of(10) {
201201
hamiltonian.update_params(
202202
math,
203203
rng,
@@ -206,7 +206,7 @@ impl<M: Math> AdaptStrategy<M> for TransformAdaptation {
206206
collector.collector2.logps.iter(),
207207
)?;
208208
}
209-
} else if (draw > 0) & (draw % self.options.transform_update_freq == 0) {
209+
} else if (draw > 0) & draw.is_multiple_of(self.options.transform_update_freq) {
210210
hamiltonian.update_params(
211211
math,
212212
rng,

0 commit comments

Comments
 (0)