Skip to content

Commit a0d3541

Browse files
committed
add lazy_static
1 parent 5e6777e commit a0d3541

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5656,6 +5656,7 @@ dependencies = [
56565656
"cargo_metadata 0.15.4",
56575657
"fluent-syntax",
56585658
"ignore",
5659+
"lazy_static",
56595660
"miropt-test-tools",
56605661
"regex",
56615662
"rustc-hash",

src/tools/tidy/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ termcolor = "1.1.3"
1616
rustc-hash = "1.1.0"
1717
fluent-syntax = "0.11.1"
1818
similar = "2.5.0"
19+
lazy_static = "1.5.0"
1920

2021
[[bin]]
2122
name = "rust-tidy"

src/tools/tidy/src/style.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// ignore-tidy-dbg
1919

2020
use crate::walk::{filter_dirs, walk};
21+
use lazy_static::lazy_static;
2122
use rustc_hash::FxHashMap;
2223
use std::{ffi::OsStr, path::Path};
2324

@@ -125,11 +126,11 @@ fn generate_problematic_strings(
125126
}
126127

127128
fn contains_problematic_const(trimmed: &str) -> bool {
128-
lazy_static::lazy_static! {
129-
static ref PROBLEMATIC_CONSTS_STRINGS: Vec<String> = generate_problematic_strings(
130-
ROOT_PROBLEMATIC_CONSTS,
131-
&FxHashMap::from_iter(LETTER_DIGIT.iter().copied()),
132-
);
129+
lazy_static! {
130+
static ref PROBLEMATIC_CONSTS_STRINGS: Vec<String> = generate_problematic_strings(
131+
ROOT_PROBLEMATIC_CONSTS,
132+
&FxHashMap::from_iter(LETTER_DIGIT.iter().copied()),
133+
);
133134
}
134135
PROBLEMATIC_CONSTS_STRINGS.iter().any(|s| trimmed.to_uppercase().contains(s))
135136
}

0 commit comments

Comments
 (0)