@@ -1251,11 +1251,18 @@ pub fn parse_color(matches: &getopts::Matches) -> ColorConfig {
12511251 }
12521252}
12531253
1254+ /// Possible json config files
1255+ pub struct JsonConfig {
1256+ pub json_rendered : HumanReadableErrorType ,
1257+ pub json_artifact_notifications : bool ,
1258+ pub json_unused_externs : bool ,
1259+ }
1260+
12541261/// Parse the `--json` flag.
12551262///
12561263/// The first value returned is how to render JSON diagnostics, and the second
12571264/// is whether or not artifact notifications are enabled.
1258- pub fn parse_json ( matches : & getopts:: Matches ) -> ( HumanReadableErrorType , bool , bool ) {
1265+ pub fn parse_json ( matches : & getopts:: Matches ) -> JsonConfig {
12591266 let mut json_rendered: fn ( ColorConfig ) -> HumanReadableErrorType =
12601267 HumanReadableErrorType :: Default ;
12611268 let mut json_color = ColorConfig :: Never ;
@@ -1285,7 +1292,12 @@ pub fn parse_json(matches: &getopts::Matches) -> (HumanReadableErrorType, bool,
12851292 }
12861293 }
12871294 }
1288- ( json_rendered ( json_color) , json_artifact_notifications, json_unused_externs)
1295+
1296+ JsonConfig {
1297+ json_rendered : json_rendered ( json_color) ,
1298+ json_artifact_notifications,
1299+ json_unused_externs,
1300+ }
12891301}
12901302
12911303/// Parses the `--error-format` flag.
@@ -1863,7 +1875,8 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
18631875
18641876 let edition = parse_crate_edition ( matches) ;
18651877
1866- let ( json_rendered, json_artifact_notifications, json_unused_externs) = parse_json ( matches) ;
1878+ let JsonConfig { json_rendered, json_artifact_notifications, json_unused_externs } =
1879+ parse_json ( matches) ;
18671880
18681881 let error_format = parse_error_format ( matches, color, json_rendered) ;
18691882
0 commit comments