Skip to content

Commit 6db8fd0

Browse files
committed
Fixed a formatting issue with medals
1 parent 7126aae commit 6db8fd0

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/dcliah/src/main.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ fn print_default(
484484
let col_w_w = col_w + 2;
485485
let col_w_h = col_w / 2;
486486
let med_header_str = format!(
487-
"{:<0map_col_w$}{:<col_w_h$}{:>0col_w$}{:>0col_w$}{:>0col_w$}{:>col_w_h$}{:>0col_w$}",
487+
"{:<0map_col_w$}{:<col_w_h$}{:>0col_w$}{:>0col_w$}{:>0col_w$}{:>col_w_h$}{:<0col_w$}",
488488
"MEDAL",
489489
"",
490490
"COUNT",
@@ -532,18 +532,18 @@ fn print_default(
532532
let gm = (activity_count as f32 / m.count as f32).ceil();
533533

534534
println!(
535-
"{:<0map_col_w$}{:<col_w_h$}{:>0col_w$}{:>0col_w$}{:>0col_w$}{:>col_w_h$}{:>0col_w$}",
536-
m.medal.name,
537-
gold,
538-
m.count.to_string(),
539-
format_f32(m.count as f32 / activity_count as f32, 2),
540-
format!("{}", gm),
541-
"",
542-
truncate_ascii_string(&m.medal.description, med_divider_len - (wep_col + (col_w_w * 3) + col_w_h * 2)),
543-
col_w = col_w_w,
544-
map_col_w = wep_col,
545-
col_w_h = col_w_h
546-
);
535+
"{:<0map_col_w$}{:<col_w_h$}{:>0col_w$}{:>0col_w$}{:>0col_w$}{:>col_w_h$}{:<0col_w$}",
536+
m.medal.name,
537+
gold,
538+
m.count.to_string(),
539+
format_f32(m.count as f32 / activity_count as f32, 2),
540+
gm.to_string(),
541+
"",
542+
truncate_ascii_string(&m.medal.description, med_divider_len - (wep_col + (col_w_w * 3) + col_w_h * 2)),
543+
col_w = col_w_w,
544+
map_col_w = wep_col,
545+
col_w_h = col_w_h
546+
);
547547
}
548548
} else {
549549
println!("No medals");

0 commit comments

Comments
 (0)