Skip to content

Commit b9c86b8

Browse files
author
Clemens Vasters
committed
fix(rust): address clippy warnings for CI compliance
- Use idiomatic (2..=7).contains(&colon_count) instead of manual range check - Collapse nested if statements in validate_extends
1 parent 39b4133 commit b9c86b8

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

rust/src/instance_validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ impl InstanceValidator {
606606
}
607607

608608
// Basic structural validation
609-
colon_count >= 2 && colon_count <= 7
609+
(2..=7).contains(&colon_count)
610610
}
611611

612612
/// Validates hostname format.

rust/src/schema_validator.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,15 +1574,13 @@ impl SchemaValidator {
15741574
}
15751575

15761576
// Resolve reference
1577-
if ref_str.starts_with("#/definitions/") {
1578-
if self.resolve_ref(&ref_str, root_schema).is_none() {
1579-
result.add_error(ValidationError::schema_error(
1580-
SchemaErrorCode::SchemaExtendsNotFound,
1581-
format!("$extends reference not found: {}", ref_str),
1582-
&ref_path,
1583-
locator.get_location(&ref_path),
1584-
));
1585-
}
1577+
if ref_str.starts_with("#/definitions/") && self.resolve_ref(&ref_str, root_schema).is_none() {
1578+
result.add_error(ValidationError::schema_error(
1579+
SchemaErrorCode::SchemaExtendsNotFound,
1580+
format!("$extends reference not found: {}", ref_str),
1581+
&ref_path,
1582+
locator.get_location(&ref_path),
1583+
));
15861584
}
15871585
// External references would be validated here if import is enabled
15881586
}

0 commit comments

Comments
 (0)