Skip to content

Commit 8391760

Browse files
committed
Use question_mark feature in librustc_errors.
1 parent bfd123d commit 8391760

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/librustc_errors/emitter.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -882,45 +882,45 @@ impl Destination {
882882
match style {
883883
Style::FileNameStyle | Style::LineAndColumn => {}
884884
Style::LineNumber => {
885-
try!(self.start_attr(term::Attr::Bold));
885+
self.start_attr(term::Attr::Bold)?;
886886
if cfg!(windows) {
887-
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN)));
887+
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN))?;
888888
} else {
889-
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
889+
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE))?;
890890
}
891891
}
892892
Style::ErrorCode => {
893-
try!(self.start_attr(term::Attr::Bold));
894-
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_MAGENTA)));
893+
self.start_attr(term::Attr::Bold)?;
894+
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_MAGENTA))?;
895895
}
896896
Style::Quotation => {}
897897
Style::OldSchoolNote => {
898-
try!(self.start_attr(term::Attr::Bold));
899-
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_GREEN)));
898+
self.start_attr(term::Attr::Bold)?;
899+
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_GREEN))?;
900900
}
901901
Style::OldSchoolNoteText | Style::HeaderMsg => {
902-
try!(self.start_attr(term::Attr::Bold));
902+
self.start_attr(term::Attr::Bold)?;
903903
if cfg!(windows) {
904-
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE)));
904+
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_WHITE))?;
905905
}
906906
}
907907
Style::UnderlinePrimary | Style::LabelPrimary => {
908-
try!(self.start_attr(term::Attr::Bold));
909-
try!(self.start_attr(term::Attr::ForegroundColor(lvl.color())));
908+
self.start_attr(term::Attr::Bold)?;
909+
self.start_attr(term::Attr::ForegroundColor(lvl.color()))?;
910910
}
911911
Style::UnderlineSecondary |
912912
Style::LabelSecondary => {
913-
try!(self.start_attr(term::Attr::Bold));
913+
self.start_attr(term::Attr::Bold)?;
914914
if cfg!(windows) {
915-
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN)));
915+
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_CYAN))?;
916916
} else {
917-
try!(self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE)));
917+
self.start_attr(term::Attr::ForegroundColor(term::color::BRIGHT_BLUE))?;
918918
}
919919
}
920920
Style::NoStyle => {}
921921
Style::Level(l) => {
922-
try!(self.start_attr(term::Attr::Bold));
923-
try!(self.start_attr(term::Attr::ForegroundColor(l.color())));
922+
self.start_attr(term::Attr::Bold)?;
923+
self.start_attr(term::Attr::ForegroundColor(l.color()))?;
924924
}
925925
}
926926
Ok(())
@@ -960,4 +960,4 @@ impl Write for Destination {
960960
Raw(ref mut w) => w.flush(),
961961
}
962962
}
963-
}
963+
}

0 commit comments

Comments
 (0)