Skip to content

Commit

Permalink
Fix all the range loops in annotate.
Browse files Browse the repository at this point in the history
  • Loading branch information
macklin-10x committed Mar 22, 2024
1 parent 0f1d996 commit 652db5c
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 237 deletions.
1 change: 0 additions & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ rustflags = [
"-A", "clippy::comparison_chain",
# TODO: burn down these allow exceptions and then deny them
"-A", "clippy::too_many_arguments",
"-W", "clippy::needless_range_loop",
]

[target.x86_64-unknown-linux-gnu]
Expand Down
6 changes: 3 additions & 3 deletions tables/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn print_tabular(
};
let nrows = rows.len();
let mut ncols = 0;
for row in rows.iter().take(nrows) {
for row in &rows[0..nrows] {
ncols = max(ncols, row.len());
}
let mut maxcol = vec![0; ncols];
Expand Down Expand Up @@ -176,7 +176,7 @@ pub fn print_tabular_vbox(
let mut rrr = rows.to_owned();
let nrows = rrr.len();
let mut ncols = 0;
for item in rrr.iter().take(nrows) {
for item in &rrr[0..nrows] {
ncols = max(ncols, item.len());
}
let mut vert = vec![false; ncols];
Expand Down Expand Up @@ -312,7 +312,7 @@ pub fn print_tabular_vbox(

// Go through the rows.

for (i, row) in rrr.iter().take(nrows).enumerate() {
for (i, row) in rrr[0..nrows].iter().enumerate() {
if debug_print {
println!("now row {} = {}", i, row.iter().format(","));
println!("0 - pushing │ onto row {i}");
Expand Down
Loading

0 comments on commit 652db5c

Please sign in to comment.