Skip to content

Commit ffaf607

Browse files
committed
Remove parse_negative_name_directive
This isn't actually used for anything, and its presence complicates the migration to `DirectiveLine`.
1 parent 505a208 commit ffaf607

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/tools/compiletest/src/directives.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,10 +1117,6 @@ impl Config {
11171117
&& matches!(line.as_bytes().get(directive.len()), None | Some(&b' ') | Some(&b':'))
11181118
}
11191119

1120-
fn parse_negative_name_directive(&self, line: &str, directive: &str) -> bool {
1121-
line.starts_with("no-") && self.parse_name_directive(&line[3..], directive)
1122-
}
1123-
11241120
fn parse_name_value_directive(
11251121
&self,
11261122
line: &str,
@@ -1149,18 +1145,8 @@ impl Config {
11491145
}
11501146

11511147
fn set_name_directive(&self, line: &str, directive: &str, value: &mut bool) {
1152-
match value {
1153-
true => {
1154-
if self.parse_negative_name_directive(line, directive) {
1155-
*value = false;
1156-
}
1157-
}
1158-
false => {
1159-
if self.parse_name_directive(line, directive) {
1160-
*value = true;
1161-
}
1162-
}
1163-
}
1148+
// If the flag is already true, don't bother looking at the directive.
1149+
*value = *value || self.parse_name_directive(line, directive);
11641150
}
11651151

11661152
fn set_name_value_directive<T>(

0 commit comments

Comments
 (0)