MCPcopy Create free account
hub / github.com/davidblewett/rure-python / left_pad_line_number

Method left_pad_line_number

regex/regex-syntax/src/error.rs:260–266  ·  view source on GitHub ↗

Left pad the given line number with spaces such that it is aligned with other line numbers.

(&self, n: usize)

Source from the content-addressed store, hash-verified

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.

Callers 1

notateMethod · 0.80

Calls 3

repeat_charFunction · 0.85
unwrapMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected