From 0f7d09b78a8374591459d9700536d0087cada27a Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Mon, 27 May 2024 14:42:25 +0300 Subject: [PATCH] chore(clippy): Apply `cargo clippy --fix` across all features --- fluent-syntax/benches/parser.rs | 2 +- fluent-syntax/tests/helper/mod.rs | 1 + fluent-syntax/tests/parser_fixtures.rs | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fluent-syntax/benches/parser.rs b/fluent-syntax/benches/parser.rs index 2397044d..71fe96e5 100644 --- a/fluent-syntax/benches/parser.rs +++ b/fluent-syntax/benches/parser.rs @@ -18,7 +18,7 @@ fn get_resources(tests: &[&'static str]) -> HashMap<&'static str, String> { let path = format!("./benches/{}", test); ftl_strings.insert(*test, read_file(&path).expect("Couldn't load file")); } - return ftl_strings; + ftl_strings } fn get_ctxs(tests: &[&'static str]) -> HashMap<&'static str, Vec> { diff --git a/fluent-syntax/tests/helper/mod.rs b/fluent-syntax/tests/helper/mod.rs index 2794a9e2..72131f95 100644 --- a/fluent-syntax/tests/helper/mod.rs +++ b/fluent-syntax/tests/helper/mod.rs @@ -94,6 +94,7 @@ pub fn adapt_ast(ast: &mut ast::Resource, crlf: bool) { pub fn strip_comments(ast: &mut ast::Resource) { ast.body.retain(|entry| match entry { + // an arm that returns false makes clippy's match_like_matches_macro a false positive ast::Entry::Comment(..) | ast::Entry::GroupComment(..) | ast::Entry::ResourceComment(..) => false, diff --git a/fluent-syntax/tests/parser_fixtures.rs b/fluent-syntax/tests/parser_fixtures.rs index eb8b9d1f..a067d38e 100644 --- a/fluent-syntax/tests/parser_fixtures.rs +++ b/fluent-syntax/tests/parser_fixtures.rs @@ -27,7 +27,7 @@ fn parse_fixtures_compare() { let reference_path = path.replace(".ftl", ".json"); let reference_file = read_file(&reference_path, true).unwrap(); - let ftl_file = read_file(&path, false).unwrap(); + let ftl_file = read_file(path, false).unwrap(); println!("Parsing: {:#?}", path); let target_ast = match parse(ftl_file) { @@ -72,7 +72,7 @@ fn parse_bench_fixtures() { file_name.replace(".ftl", ".json") ); let reference_file = read_file(&reference_path, true).unwrap(); - let ftl_file = read_file(&path, false).unwrap(); + let ftl_file = read_file(path, false).unwrap(); println!("Parsing: {:#?}", path); let target_ast = match parse(ftl_file) { @@ -106,7 +106,7 @@ fn parse_bench_fixtures() { file_name.replace(".ftl", ".json") ); let reference_file = read_file(&reference_path, true).unwrap(); - let ftl_file = read_file(&path, false).unwrap(); + let ftl_file = read_file(path, false).unwrap(); println!("Parsing: {:#?}", path); let target_ast = match parse(ftl_file.clone()) {