Skip to content

Commit

Permalink
refactor: remove reference to Shape::to_serde()
Browse files Browse the repository at this point in the history
  • Loading branch information
jshearer committed Aug 4, 2023
1 parent 7ba0c0f commit 32399a6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions crates/doc/src/reduce/strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,17 @@ impl Strategy {
let right = shape_from_node(rhs).map_err(|e| Error::with_location(e, loc))?;

// Union together the LHS and RHS, and convert back from `Shape` into `HeapNode`.
let merged_doc = Shape::union(left, right)
.to_serde()
.and_then(|value| HeapNode::from_serde(value, alloc))
.map_err(|e| {
Error::with_location(
Error::JsonSchemaMergeWrongType {
detail: Some(e.to_string()),
},
loc,
)
})?;
let merged_doc =
serde_json::to_value(&SchemaBuilder::new(Shape::union(left, right)).root_schema())
.and_then(|value| HeapNode::from_serde(value, alloc))
.map_err(|e| {
Error::with_location(
Error::JsonSchemaMergeWrongType {
detail: Some(e.to_string()),
},
loc,
)
})?;

*tape = &tape[rhs_tape_len..];

Expand Down

0 comments on commit 32399a6

Please sign in to comment.