Skip to content

Commit af68efe

Browse files
authored
rm unnecessary boxing (#33)
1 parent 0276ef2 commit af68efe

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ pub fn diff(lhs: Value, rhs: Value) -> Result<Vec<Change>, Error> {
1818
let rhs_root: RootSchema = serde_json::from_value(rhs)?;
1919

2020
let mut changes = vec![];
21-
let cb = |change: Change| {
22-
changes.push(change);
23-
};
24-
let mut walker = diff_walker::DiffWalker::new(Box::new(cb), lhs_root, rhs_root);
21+
let mut walker = diff_walker::DiffWalker::new(
22+
|change: Change| {
23+
changes.push(change);
24+
},
25+
lhs_root,
26+
rhs_root,
27+
);
2528
walker.diff(
2629
"",
2730
&mut walker.lhs_root.schema.clone(),
2831
&mut walker.rhs_root.schema.clone(),
2932
)?;
30-
drop(walker);
31-
3233
Ok(changes)
3334
}

0 commit comments

Comments
 (0)