Skip to content

Commit

Permalink
Use question_mark feature in librustc_errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedcharles committed Sep 11, 2016
1 parent bfd123d commit 8391760
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/librustc_errors/emitter.rs
Expand Up @@ -882,45 +882,45 @@ impl Destination {
match style {
Style::FileNameStyle | Style::LineAndColumn => {}
Style::LineNumber => {
try!(self.start_attr(term::Attr::Bold));
self.start_attr(term::Attr::Bold)?;
if cfg!(windows) {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN)));
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN))?;
} else {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE))?;
}
}
Style::ErrorCode => {
try!(self.start_attr(term::Attr::Bold));
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_MAGENTA)));
self.start_attr(term::Attr::Bold)?;
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_MAGENTA))?;
}
Style::Quotation => {}
Style::OldSchoolNote => {
try!(self.start_attr(term::Attr::Bold));
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_GREEN)));
self.start_attr(term::Attr::Bold)?;
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_GREEN))?;
}
Style::OldSchoolNoteText | Style::HeaderMsg => {
try!(self.start_attr(term::Attr::Bold));
self.start_attr(term::Attr::Bold)?;
if cfg!(windows) {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE)));
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE))?;
}
}
Style::UnderlinePrimary | Style::LabelPrimary => {
try!(self.start_attr(term::Attr::Bold));
try!(self.start_attr(term::Attr::ForegroundColor(lvl.color())));
self.start_attr(term::Attr::Bold)?;
self.start_attr(term::Attr::ForegroundColor(lvl.color()))?;
}
Style::UnderlineSecondary |
Style::LabelSecondary => {
try!(self.start_attr(term::Attr::Bold));
self.start_attr(term::Attr::Bold)?;
if cfg!(windows) {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN)));
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN))?;
} else {
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE))?;
}
}
Style::NoStyle => {}
Style::Level(l) => {
try!(self.start_attr(term::Attr::Bold));
try!(self.start_attr(term::Attr::ForegroundColor(l.color())));
self.start_attr(term::Attr::Bold)?;
self.start_attr(term::Attr::ForegroundColor(l.color()))?;
}
}
Ok(())
Expand Down Expand Up @@ -960,4 +960,4 @@ impl Write for Destination {
Raw(ref mut w) => w.flush(),
}
}
}
}

0 comments on commit 8391760

Please sign in to comment.