Skip to content

Commit

Permalink
Obey clippy and cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen committed May 3, 2022
1 parent 39e6671 commit 3e33b6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fn calculate_consensus<'a, T: Iterator<Item = &'a Vec<u8>>>(
.collect();
}

fn move_element<T>(v: &mut Vec<T>, from: usize, to: usize) -> Option<()> {
fn move_element<T>(v: &mut [T], from: usize, to: usize) -> Option<()> {
if from.max(to) >= v.len() {
return None;
}
Expand Down Expand Up @@ -365,7 +365,7 @@ impl Alignment {
// Now transform order such that if the order begins with [8, 3, 0], then the 8th
// index is 0, 3th index is 1, 0th index is 2 etc.
// That means we can sort the entries by looking up directly in the order
let mut ord: Vec<u32> = vec![0; self.nrows().try_into().unwrap()];
let mut ord: Vec<u32> = vec![0; self.nrows()];
for (i, o) in order.iter().enumerate() {
ord[*o] = i.try_into().unwrap()
}
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// To do: Implement multithreading. One thread reads input and moves view etc,
// another draws. Drawings can be "skipped" if there are still queued inputs, perhaps?

// The 'order' field could be u32
// Optimize ordering, or allow to exit. It can be quite slow, I think.

mod constants;
Expand Down

0 comments on commit 3e33b6c

Please sign in to comment.