Skip to content

Commit 420dfeb

Browse files
committed
tidy: simplify fluent file extension checking
1 parent 1053f58 commit 420dfeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tools/tidy/src/fluent_alphabetical.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ fn message() -> &'static Regex {
1313
static_regex!(r#"(?m)^([a-zA-Z0-9_]+)\s*=\s*"#)
1414
}
1515

16-
fn filter_fluent(path: &Path) -> bool {
17-
if let Some(ext) = path.extension() { ext.to_str() != Some("ftl") } else { true }
16+
fn is_fluent(path: &Path) -> bool {
17+
path.extension().is_some_and(|ext| ext == "flt")
1818
}
1919

2020
fn check_alphabetic(
@@ -92,7 +92,7 @@ pub fn check(path: &Path, bless: bool, bad: &mut bool) {
9292
let mut all_defined_msgs = HashMap::new();
9393
walk(
9494
path,
95-
|path, is_dir| filter_dirs(path) || (!is_dir && filter_fluent(path)),
95+
|path, is_dir| filter_dirs(path) || (!is_dir && !is_fluent(path)),
9696
&mut |ent, contents| {
9797
if bless {
9898
let sorted = sort_messages(

0 commit comments

Comments
 (0)