Skip to content

chore: consistent return type among methods #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/diff_walker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ impl DiffWalker {

/// Split a schema into multiple schemas, one for each type in the multiple type.
/// Returns the new schema and whether the schema was changed.
fn split_types(schema_object: &mut SchemaObject) -> (&mut SchemaObject, bool) {
fn split_types(schema_object: &mut SchemaObject) -> bool {
let is_split = match schema_object.effective_type() {
InternalJsonSchemaType::Multiple(types)
if schema_object.subschemas().any_of.is_none() =>
Expand All @@ -381,7 +381,7 @@ impl DiffWalker {
}
_ => false,
};
(schema_object, is_split)
is_split
}

fn do_diff(
Expand All @@ -393,8 +393,8 @@ impl DiffWalker {
rhs: &mut SchemaObject,
) -> Result<(), Error> {
self.resolve_references(lhs, rhs)?;
let (lhs, is_lhs_split) = Self::split_types(lhs);
let (rhs, is_rhs_split) = Self::split_types(rhs);
let is_lhs_split = Self::split_types(lhs);
let is_rhs_split = Self::split_types(rhs);
self.diff_any_of(json_path, is_rhs_split, lhs, rhs)?;
if !comparing_any_of {
self.diff_instance_types(json_path, lhs, rhs);
Expand Down