diff options
| author | bors <bors@rust-lang.org> | 2016-09-13 22:41:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-13 22:41:34 -0700 |
| commit | 739d57180fa207410b8858f8cede7b8a9ea6f01e (patch) | |
| tree | 48bd42052665b2f0b5c7b82ffadd10d0e1844a53 /src/librustc_errors | |
| parent | b1363a73ede57ae595f3a1be2bb75d308ba4f7f6 (diff) | |
| parent | 694d601dbc2df575c32a490a529656a864dc0a2e (diff) | |
| download | rust-739d57180fa207410b8858f8cede7b8a9ea6f01e.tar.gz rust-739d57180fa207410b8858f8cede7b8a9ea6f01e.zip | |
Auto merge of #36041 - ahmedcharles:try, r=nrc
Replace try! with ?.
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/emitter.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index dcdbe2a8525..1bdc9ef3088 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 +} |
