Left pad the given line number with spaces such that it is aligned with other line numbers.
(&self, n: usize)
| 258 | /// Left pad the given line number with spaces such that it is aligned with |
| 259 | /// other line numbers. |
| 260 | fn left_pad_line_number(&self, n: usize) -> String { |
| 261 | let n = n.to_string(); |
| 262 | let pad = self.line_number_width.checked_sub(n.len()).unwrap(); |
| 263 | let mut result = repeat_char(' ', pad); |
| 264 | result.push_str(&n); |
| 265 | result |
| 266 | } |
| 267 | |
| 268 | /// Return the line number padding beginning at the start of each line of |
| 269 | /// the pattern. |
no test coverage detected