Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address more clippy issues #363

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fluent-syntax/benches/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>> {
Expand Down
1 change: 1 addition & 0 deletions fluent-syntax/tests/helper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ pub fn adapt_ast(ast: &mut ast::Resource<String>, crlf: bool) {

pub fn strip_comments(ast: &mut ast::Resource<String>) {
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,
Expand Down
6 changes: 3 additions & 3 deletions fluent-syntax/tests/parser_fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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()) {
Expand Down