Skip to content

Commit 391864e

Browse files
committed
fix: resolve remaining fmt and clippy errors
rustfmt (rust 1.95) collapses two multiline match arms in the validation module onto single lines; apply cargo fmt. Clippy's collapsible_match also fires on the html5lib tree construction test harness — lift the inner `if !line.is_empty()` checks into match guards to match the fix already applied to the library sources in 29f404e.
1 parent 29f404e commit 391864e

3 files changed

Lines changed: 6 additions & 14 deletions

File tree

src/validation/dtd.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2556,9 +2556,7 @@ fn validate_attributes(
25562556
column: None,
25572557
});
25582558
}
2559-
(AttributeDefault::Fixed(fixed_val), Some(attr))
2560-
if attr.value != *fixed_val =>
2561-
{
2559+
(AttributeDefault::Fixed(fixed_val), Some(attr)) if attr.value != *fixed_val => {
25622560
errors.push(ValidationError {
25632561
message: format!(
25642562
"attribute '{}' on element '{elem_name}' must have \

src/validation/xsd.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,9 +1775,7 @@ fn validate_builtin_value(
17751775
}
17761776
"dateTime" if !is_valid_datetime_pattern(value) => {
17771777
errors.push(ValidationError {
1778-
message: format!(
1779-
"value \"{value}\" in <{context}> is not a valid dateTime"
1780-
),
1778+
message: format!("value \"{value}\" in <{context}> is not a valid dateTime"),
17811779
line: None,
17821780
column: None,
17831781
});

tests/html5lib_tree_construction.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,11 @@ fn parse_test_file(content: &str) -> Vec<TreeTest> {
105105
}
106106
data.push_str(line);
107107
}
108-
"errors" => {
109-
if !line.is_empty() {
110-
errors += 1;
111-
}
108+
"errors" if !line.is_empty() => {
109+
errors += 1;
112110
}
113-
"new-errors" => {
114-
if !line.is_empty() {
115-
new_errors += 1;
116-
}
111+
"new-errors" if !line.is_empty() => {
112+
new_errors += 1;
117113
}
118114
"fragment" => {
119115
fragment_context = Some(line.to_string());

0 commit comments

Comments
 (0)