@@ -1298,35 +1298,28 @@ impl LangString {
1298
1298
}
1299
1299
LangStringToken :: LangToken ( x) if extra. is_some ( ) => {
1300
1300
let s = x. to_lowercase ( ) ;
1301
- if let Some ( ( flag, help) ) = if s == "compile-fail"
1302
- || s == "compile_fail"
1303
- || s == "compilefail"
1304
- {
1305
- Some ( (
1301
+ if let Some ( ( flag, help) ) = match s. as_str ( ) {
1302
+ "compile-fail" | "compile_fail" | "compilefail" => Some ( (
1306
1303
"compile_fail" ,
1307
- "the code block will either not be tested if not marked as a rust one \
1308
- or won't fail if it compiles successfully",
1309
- ) )
1310
- } else if s == "should-panic" || s == "should_panic" || s == "shouldpanic" {
1311
- Some ( (
1304
+ "the code block will either not be tested if not marked as a rust \
1305
+ one or won't fail if it compiles successfully",
1306
+ ) ) ,
1307
+ "should-panic" | "should_panic" | "shouldpanic" => Some ( (
1312
1308
"should_panic" ,
1313
- "the code block will either not be tested if not marked as a rust one \
1314
- or won't fail if it doesn't panic when running",
1315
- ) )
1316
- } else if s == "no-run" || s == "no_run" || s == "norun" {
1317
- Some ( (
1309
+ "the code block will either not be tested if not marked as a rust \
1310
+ one or won't fail if it doesn't panic when running",
1311
+ ) ) ,
1312
+ "no-run" | "no_run" | "norun" => Some ( (
1318
1313
"no_run" ,
1319
- "the code block will either not be tested if not marked as a rust one \
1320
- or will be run (which you might not want)",
1321
- ) )
1322
- } else if s == "test-harness" || s == "test_harness" || s == "testharness" {
1323
- Some ( (
1314
+ "the code block will either not be tested if not marked as a rust \
1315
+ one or will be run (which you might not want)",
1316
+ ) ) ,
1317
+ "test-harness" | "test_harness" | "testharness" => Some ( (
1324
1318
"test_harness" ,
1325
- "the code block will either not be tested if not marked as a rust one \
1326
- or the code will be wrapped inside a main function",
1327
- ) )
1328
- } else {
1329
- None
1319
+ "the code block will either not be tested if not marked as a rust \
1320
+ one or the code will be wrapped inside a main function",
1321
+ ) ) ,
1322
+ _ => None ,
1330
1323
} {
1331
1324
if let Some ( extra) = extra {
1332
1325
extra. error_invalid_codeblock_attr_with_help (
0 commit comments