use std::io;
use std::io::Write;
io::stdout().flush();
let mut data = dark.iter().collect::<Vec<(&u64, &u32)>>();
data.sort_by(|a, b| a.0.cmp(&b.0));
for (i, v) in dark {
println!("{}: {:|<1$}", i, *v as usize);
}
and got a long stdout
44390000: 282|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
it takes too much room to show the ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
i want to reduce the gap length of |
how can i apply it in println!
?