aboutsummaryrefslogtreecommitdiff
path: root/chain/src/item/default/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'chain/src/item/default/mod.rs')
-rw-r--r--chain/src/item/default/mod.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/chain/src/item/default/mod.rs b/chain/src/item/default/mod.rs
index f532805..eef7def 100644
--- a/chain/src/item/default/mod.rs
+++ b/chain/src/item/default/mod.rs
@@ -535,7 +535,7 @@ impl<T: GraphLabel> Forest<T> for DefaultForest<ForestLabel<T>> {
builder.add_edge(f_node, f_child, node_label)?;
}
}
- } else if !children_match_p(&builder, f_node, fragment.borrow(), node)? {
+ } else if !children_match_p(&builder, f_node, fragment, node)? {
let cloned = self.clone_node(f_node, 0, false)?;
let mut builder = PLGBuilderMut::from_graph_mut(&mut self.graph);
@@ -594,8 +594,7 @@ impl<T: GraphLabel> Forest<T> for DefaultForest<ForestLabel<T>> {
for cloned_child in fragment.children_of(node)? {
let builder = PLGBuilderMut::from_graph_mut(&mut self.graph);
- if !children_match_p(&builder, f_node, fragment.borrow(), cloned_child)?
- {
+ if !children_match_p(&builder, f_node, fragment, cloned_child)? {
let cloned = self.clone_node(f_node, 0, false)?;
let mut builder = PLGBuilderMut::from_graph_mut(&mut self.graph);
@@ -652,7 +651,7 @@ impl<T: GraphLabel> Forest<T> for DefaultForest<ForestLabel<T>> {
continue 'node_loop;
}
- if children_match_p(&builder, f_node_clone, fragment.borrow(), node)? {
+ if children_match_p(&builder, f_node_clone, fragment, node)? {
continue 'node_loop;
}
}
@@ -720,12 +719,8 @@ impl<T: GraphLabel> Forest<T> for DefaultForest<ForestLabel<T>> {
continue 'node_loop;
}
- if children_match_p(
- &builder,
- f_node_clone,
- fragment.borrow(),
- cloned_child,
- )? {
+ if children_match_p(&builder, f_node_clone, fragment, cloned_child)?
+ {
continue 'cloned_loop;
}
}
@@ -1187,6 +1182,7 @@ impl DefaultForest<ForestLabel<GrammarLabel>> {
let mut file = std::fs::File::options()
.write(true)
.create(true)
+ .truncate(true)
.open(&filename)?;
use std::io::Write;