Skip to content

Commit

Permalink
fix: tests and suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra authored and idubrov committed Sep 11, 2023
1 parent 227dd99 commit d3a5a12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ fn test(doc: &Value, path: &str, expected: &Value) -> Result<(), PatchErrorKind>
/// # }
/// ```
pub fn patch(doc: &mut Value, patch: &[PatchOperation]) -> Result<(), PatchError> {
let mut undo_stack = Vec::new();
let mut undo_stack = Vec::with_capacity(patch.len());
if let Err(e) = apply_patches(doc, patch, Some(&mut undo_stack)) {
if let Err(e) = undo_patches(doc, &undo_stack) {
unreachable!("unable to undo applied patches: {e}")
Expand Down

0 comments on commit d3a5a12

Please sign in to comment.