Skip to content

Commit 6a34732

Browse files
committed
derive Default trait for compiletest::common::Config
1 parent c36b209 commit 6a34732

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

library/test/src/options.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@ pub enum ShouldPanic {
1616
}
1717

1818
/// Whether should console output be colored or not
19-
#[derive(Copy, Clone, Debug)]
19+
#[derive(Copy, Clone, Default, Debug)]
2020
pub enum ColorConfig {
21+
#[default]
2122
AutoColor,
2223
AlwaysColor,
2324
NeverColor,
2425
}
2526

2627
/// Format of the test results output
27-
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
28+
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
2829
pub enum OutputFormat {
2930
/// Verbose output
3031
Pretty,
3132
/// Quiet output
33+
#[default]
3234
Terse,
3335
/// JSON output
3436
Json,

src/tools/compiletest/src/common.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ string_enum! {
6969
}
7070
}
7171

72+
impl Default for Mode {
73+
fn default() -> Self {
74+
Mode::Ui
75+
}
76+
}
77+
7278
impl Mode {
7379
pub fn disambiguator(self) -> &'static str {
7480
// Pretty-printing tests could run concurrently, and if they do,
@@ -125,7 +131,7 @@ pub enum PanicStrategy {
125131
}
126132

127133
/// Configuration for compiletest
128-
#[derive(Debug, Clone)]
134+
#[derive(Debug, Default, Clone)]
129135
pub struct Config {
130136
/// `true` to overwrite stderr/stdout files instead of complaining about changes in output.
131137
pub bless: bool,

0 commit comments

Comments
 (0)