diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-06-21 12:08:26 -0400 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-06-23 09:10:26 -0400 |
| commit | 5c33c3e308a4fb6d93352115ec00e99d1920eff7 (patch) | |
| tree | 9794508399b250c14b85e62bdb7c92d51aca3d6e /src | |
| parent | e17b02d9b98dae037df2761a84d9dae066ba7e31 (diff) | |
| download | rust-5c33c3e308a4fb6d93352115ec00e99d1920eff7.tar.gz rust-5c33c3e308a4fb6d93352115ec00e99d1920eff7.zip | |
Stop calling format! to check feature gate
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/tidy/src/features.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs index ced30eb6d58..da138794297 100644 --- a/src/tools/tidy/src/features.rs +++ b/src/tools/tidy/src/features.rs @@ -186,9 +186,11 @@ fn test_find_attr_val() { } fn test_filen_gate(filen_underscore: &str, features: &mut Features) -> bool { - if filen_underscore.starts_with("feature_gate") { + let prefix = "feature_gate_"; + if filen_underscore.starts_with(prefix) { for (n, f) in features.iter_mut() { - if filen_underscore == format!("feature_gate_{}", n) { + // Equivalent to filen_underscore == format!("feature_gate_{}", n) + if &filen_underscore[prefix.len()..] == n { f.has_gate_test = true; return true; } |
