File tree 4 files changed +10
-4
lines changed
4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,12 @@ pub enum HumanReadableErrorType {
48
48
Short ,
49
49
}
50
50
51
+ impl HumanReadableErrorType {
52
+ fn short ( & self ) -> bool {
53
+ self == HumanReadableErrorType :: Short
54
+ }
55
+ }
56
+
51
57
#[ derive( Clone , Copy , Debug ) ]
52
58
struct Margin {
53
59
/// The available whitespace in the left that can be consumed when centering.
Original file line number Diff line number Diff line change @@ -951,7 +951,7 @@ fn default_emitter(
951
951
} ;
952
952
match sopts. error_format {
953
953
config:: ErrorOutputType :: HumanReadable ( kind, color_config) => {
954
- let short = matches ! ( kind, HumanReadableErrorType :: Short ) ;
954
+ let short = kind. short ( ) ;
955
955
956
956
if let HumanReadableErrorType :: AnnotateSnippet = kind {
957
957
let emitter = AnnotateSnippetEmitter :: new (
@@ -1427,7 +1427,7 @@ fn mk_emitter(output: ErrorOutputType) -> Box<DynEmitter> {
1427
1427
fallback_fluent_bundle ( vec ! [ rustc_errors:: DEFAULT_LOCALE_RESOURCE ] , false ) ;
1428
1428
let emitter: Box < DynEmitter > = match output {
1429
1429
config:: ErrorOutputType :: HumanReadable ( kind, color_config) => {
1430
- let short = matches ! ( kind, HumanReadableErrorType :: Short ) ;
1430
+ let short = kind. short ( ) ;
1431
1431
Box :: new (
1432
1432
HumanEmitter :: new ( stderr_destination ( color_config) , fallback_bundle)
1433
1433
. short_message ( short) ,
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ pub(crate) fn new_dcx(
139
139
) ;
140
140
let emitter: Box < DynEmitter > = match error_format {
141
141
ErrorOutputType :: HumanReadable ( kind, color_config) => {
142
- let short = matches ! ( kind, HumanReadableErrorType :: Short ) ;
142
+ let short = kind. short ( ) ;
143
143
Box :: new (
144
144
HumanEmitter :: new ( stderr_destination ( color_config) , fallback_bundle)
145
145
. sm ( source_map. map ( |sm| sm as _ ) )
Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ fn run_test(
423
423
}
424
424
} ) ;
425
425
if let ErrorOutputType :: HumanReadable ( kind, color_config) = rustdoc_options. error_format {
426
- let short = matches ! ( kind, HumanReadableErrorType :: Short ) ;
426
+ let short = kind. short ( ) ;
427
427
428
428
if short {
429
429
compiler. arg ( "--error-format" ) . arg ( "short" ) ;
You can’t perform that action at this time.
0 commit comments