fix: clippy lints
This commit is contained in:
parent
78e5144f3f
commit
274e60a523
10 changed files with 17 additions and 22 deletions
|
|
@ -307,9 +307,8 @@ fn write_color(buffer: &mut String, color: Color) {
|
|||
}
|
||||
|
||||
fn terminal_supports_truecolor() -> bool {
|
||||
std::env::var("COLORTERM").map_or(false, |truecolor| {
|
||||
truecolor == "truecolor" || truecolor == "24bit"
|
||||
})
|
||||
std::env::var("COLORTERM")
|
||||
.is_ok_and(|truecolor| truecolor == "truecolor" || truecolor == "24bit")
|
||||
}
|
||||
|
||||
fn closest_xterm_color(red: u8, green: u8, blue: u8) -> Color {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue