fix: clippy lints

This commit is contained in:
Amaan Qureshi 2024-11-16 03:20:59 -05:00
parent 78e5144f3f
commit 274e60a523
No known key found for this signature in database
GPG key ID: E67890ADC4227273
10 changed files with 17 additions and 22 deletions

View file

@ -84,7 +84,7 @@ pub fn get_test_language(name: &str, parser_code: &str, path: Option<&Path>) ->
fs::create_dir_all(&src_dir).unwrap();
let parser_path = src_dir.join("parser.c");
if !fs::read_to_string(&parser_path).map_or(false, |content| content == parser_code) {
if !fs::read_to_string(&parser_path).is_ok_and(|content| content == parser_code) {
fs::write(&parser_path, parser_code).unwrap();
}
@ -93,8 +93,7 @@ pub fn get_test_language(name: &str, parser_code: &str, path: Option<&Path>) ->
if scanner_path.exists() {
let scanner_code = fs::read_to_string(&scanner_path).unwrap();
let scanner_copy_path = src_dir.join("scanner.c");
if !fs::read_to_string(&scanner_copy_path)
.map_or(false, |content| content == scanner_code)
if !fs::read_to_string(&scanner_copy_path).is_ok_and(|content| content == scanner_code)
{
fs::write(&scanner_copy_path, scanner_code).unwrap();
}