(n: u64)
| 662 | } |
| 663 | |
| 664 | fn format_number(n: u64) -> String { |
| 665 | let s = n.to_string(); |
| 666 | let mut result = String::with_capacity(s.len() + s.len() / 3); |
| 667 | for (i, c) in s.chars().rev().enumerate() { |
| 668 | if i > 0 && i % 3 == 0 { |
| 669 | result.push(','); |
| 670 | } |
| 671 | result.push(c); |
| 672 | } |
| 673 | result.chars().rev().collect() |
| 674 | } |
| 675 | |
| 676 | #[cfg(test)] |
| 677 | #[allow(clippy::unwrap_used, clippy::expect_used)] |
no test coverage detected