style: tidying

This commit is contained in:
Amaan Qureshi 2024-02-17 19:34:55 -05:00
parent d95fcc83b9
commit fd91404ab0
7 changed files with 15 additions and 16 deletions

View file

@ -144,9 +144,7 @@ impl Serialize for Theme {
impl Default for Theme {
fn default() -> Self {
serde_json::from_str(
r#"
{
serde_json::from_value(json!({
"attribute": {"color": 124, "italic": true},
"comment": {"color": 245, "italic": true},
"constant.builtin": {"color": 94, "bold": true},
@ -169,9 +167,7 @@ impl Default for Theme {
"type.builtin": {"color": 23, "bold": true},
"variable.builtin": {"bold": true},
"variable.parameter": {"underline": true}
}
"#,
)
}))
.unwrap()
}
}

View file

@ -308,7 +308,8 @@ pub fn parse_file_at_path(parser: &mut Parser, opts: &ParseFileOptions) -> Resul
if node.is_error() || node.is_missing() {
first_error = Some(node);
break;
} else if !cursor.goto_first_child() {
}
if !cursor.goto_first_child() {
break;
}
} else if !cursor.goto_next_sibling() {
@ -355,7 +356,9 @@ pub fn parse_file_at_path(parser: &mut Parser, opts: &ParseFileOptions) -> Resul
bytes: source_code.len(),
duration: Some(duration),
});
} else if opts.print_time {
}
if opts.print_time {
let duration = time.elapsed();
let duration_ms = duration.as_micros() as f64 / 1e3;
writeln!(

View file

@ -117,9 +117,9 @@ pub fn get_test_language(name: &str, parser_code: &str, path: Option<&Path>) ->
.unwrap();
let paths_to_check = if let Some(scanner_path) = &scanner_path {
vec![parser_path.clone(), scanner_path.to_path_buf()]
vec![parser_path, scanner_path.clone()]
} else {
vec![parser_path.clone()]
vec![parser_path]
};
TEST_LOADER