Skip to content

Commit

Permalink
fix: apply clippy suggestions. (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
user-0xcafe authored Oct 2, 2023
1 parent 9717e44 commit c977be2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/guinea/cli2gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ fn is_concurrent(data: &mut Guineacorn) -> bool {
if !thread.is_finished() {
return true;
}
let thread = std::mem::replace(&mut data.loading_data.processing_thread, None).unwrap();
let thread = data.loading_data.processing_thread.take().unwrap();
let serial_model = thread.join();
match serial_model {
Ok(model) => {
Expand Down
4 changes: 2 additions & 2 deletions src/guinea/giraphe/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl Giraphe {
}

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

if self.tick == spot.tick {
Expand Down Expand Up @@ -492,7 +492,7 @@ impl Giraphe {
Node::Comment(_) => unreachable!(),
};

let mut spot = self.node_lookup.get_mut(nid).unwrap();
let spot = self.node_lookup.get_mut(nid).unwrap();
spot.current_value = new_value.clone();
new_value
}
Expand Down
8 changes: 2 additions & 6 deletions src/unicorn/qubot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,17 +877,13 @@ impl InputEvaluator {
if !value_x1 {
if !value_x2 {
aux = false;
} else if !value_x3 {
aux = true;
} else {
aux = false;
aux = !value_x3;
}
} else if value_x2 {
aux = true;
} else if value_x3 {
aux = false;
} else {
aux = true;
aux = !value_x3;
}

self.fixed_qubits.insert(z, aux);
Expand Down

0 comments on commit c977be2

Please sign in to comment.