From 8391760bd846740ea13f9c415a00af10a0b735d1 Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Sat, 27 Aug 2016 02:21:36 -0700 Subject: [PATCH] Use question_mark feature in librustc_errors. --- src/librustc_errors/emitter.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index dcdbe2a85259b..1bdc9ef30881f 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -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(()) @@ -960,4 +960,4 @@ impl Write for Destination { Raw(ref mut w) => w.flush(), } } -} \ No newline at end of file +}