Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9a89193

Browse files
committed
refactor: Rename variable
The fold chaining is to find max line number rather than line number width
1 parent 7ffe4b2 commit 9a89193

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/renderer/display_list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ impl<'a> fmt::Debug for DisplayList<'a> {
7272

7373
impl<'a> Display for DisplayList<'a> {
7474
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
75-
let lineno_width = self.body.iter().fold(None, |max, set| {
75+
let max_lineno = self.body.iter().fold(None, |max, set| {
7676
set.display_lines.iter().fold(max, |max, line| match line {
7777
DisplayLine::Source { lineno, .. } => std::cmp::max(max, *lineno),
7878
_ => max,
7979
})
8080
});
81-
let lineno_width = match lineno_width {
81+
let lineno_width = match max_lineno {
8282
None => 0,
8383
Some(_max) if self.anonymized_line_numbers => ANONYMIZED_LINE_NUM.len(),
8484
Some(0) => 1,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /