Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5c33c3e

Browse files
Stop calling format! to check feature gate
1 parent e17b02d commit 5c33c3e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tools/tidy/src/features.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,11 @@ fn test_find_attr_val() {
186186
}
187187

188188
fn test_filen_gate(filen_underscore: &str, features: &mut Features) -> bool {
189-
if filen_underscore.starts_with("feature_gate") {
189+
let prefix = "feature_gate_";
190+
if filen_underscore.starts_with(prefix) {
190191
for (n, f) in features.iter_mut() {
191-
if filen_underscore == format!("feature_gate_{}", n) {
192+
// Equivalent to filen_underscore == format!("feature_gate_{}", n)
193+
if &filen_underscore[prefix.len()..] == n {
192194
f.has_gate_test = true;
193195
return true;
194196
}

0 commit comments

Comments
 (0)