Skip to content

Commit

Permalink
Remove magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jan 9, 2017
1 parent b206064 commit 6904761
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc_errors/emitter.rs
Expand Up @@ -737,8 +737,8 @@ impl EmitterWriter {
buffer.append(0, &level.to_string(), Style::HeaderMsg);
buffer.append(0, ": ", Style::NoStyle);

// The extra 9 ` ` is the padding that's always needed to align to the `note: `.
let message = self.msg_with_padding(msg, max_line_num_len + 9);
// The extra 3 ` ` is the padding that's always needed to align to the `note: `.
let message = self.msg_with_padding(msg, max_line_num_len + "note: ".len() + 3);
buffer.append(0, &message, Style::NoStyle);
} else {
buffer.append(0, &level.to_string(), Style::Level(level.clone()));
Expand Down Expand Up @@ -873,8 +873,8 @@ impl EmitterWriter {
buffer.append(0, &level.to_string(), Style::Level(level.clone()));
buffer.append(0, ": ", Style::HeaderMsg);

// The extra 15 ` ` is the padding that's always needed to align to the `suggestion: `.
let message = self.msg_with_padding(msg, max_line_num_len + 15);
// The extra 3 ` ` is the padding that's always needed to align to the `suggestion: `.
let message = self.msg_with_padding(msg, max_line_num_len + "suggestion: ".len() + 3);
buffer.append(0, &message, Style::HeaderMsg);

let lines = cm.span_to_lines(primary_span).unwrap();
Expand Down

0 comments on commit 6904761

Please sign in to comment.