Skip to content

Commit c977be2

Browse files
authored
fix: apply clippy suggestions. (#63)
1 parent 9717e44 commit c977be2

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/guinea/cli2gui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ fn is_concurrent(data: &mut Guineacorn) -> bool {
342342
if !thread.is_finished() {
343343
return true;
344344
}
345-
let thread = std::mem::replace(&mut data.loading_data.processing_thread, None).unwrap();
345+
let thread = data.loading_data.processing_thread.take().unwrap();
346346
let serial_model = thread.join();
347347
match serial_model {
348348
Ok(model) => {

src/guinea/giraphe/graph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl Giraphe {
287287
}
288288

289289
pub(crate) fn evaluate(&mut self, nid: &Nid) -> Value {
290-
let mut spot = self.node_lookup.get_mut(nid).unwrap();
290+
let spot = self.node_lookup.get_mut(nid).unwrap();
291291
spot.old_value = spot.current_value.clone();
292292

293293
if self.tick == spot.tick {
@@ -492,7 +492,7 @@ impl Giraphe {
492492
Node::Comment(_) => unreachable!(),
493493
};
494494

495-
let mut spot = self.node_lookup.get_mut(nid).unwrap();
495+
let spot = self.node_lookup.get_mut(nid).unwrap();
496496
spot.current_value = new_value.clone();
497497
new_value
498498
}

src/unicorn/qubot.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -877,17 +877,13 @@ impl InputEvaluator {
877877
if !value_x1 {
878878
if !value_x2 {
879879
aux = false;
880-
} else if !value_x3 {
881-
aux = true;
882880
} else {
883-
aux = false;
881+
aux = !value_x3;
884882
}
885883
} else if value_x2 {
886884
aux = true;
887-
} else if value_x3 {
888-
aux = false;
889885
} else {
890-
aux = true;
886+
aux = !value_x3;
891887
}
892888

893889
self.fixed_qubits.insert(z, aux);

0 commit comments

Comments
 (0)