From b8a2d05a3c0d835556d5ddbd44e4a1e201302af5 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Thu, 10 Aug 2023 11:14:04 +0800 Subject: Move the trait `Forest` to the crate "forest". The purpose of this change is to share this trait with other crates, such as the forth-coming "semiring" crate that will be responsible for handling some simple semiring operations as well as the querying, in my plans. --- chain/src/item/default/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chain/src/item/default') diff --git a/chain/src/item/default/mod.rs b/chain/src/item/default/mod.rs index de43f37..01e463e 100644 --- a/chain/src/item/default/mod.rs +++ b/chain/src/item/default/mod.rs @@ -200,7 +200,7 @@ impl Forest for DefaultForest> { let transformed_label = transform(vertex_label.label()); - let transformed_label = ForestLabel::new(transformed_label, vertex_label.status); + let transformed_label = ForestLabel::new(transformed_label, vertex_label.status()); let mut builder = PLGBuilderMut::from_graph_mut(&mut self.graph); @@ -1239,7 +1239,7 @@ impl DefaultForest> { label_label.set_start(pos); - let new_label = ForestLabel::new(label_label, label.status); + let new_label = ForestLabel::new(label_label, label.status()); builder.set_label(node, new_label)?; } @@ -1306,7 +1306,7 @@ impl DefaultForest> { label_label.set_end(pos + 1); } - let new_label = ForestLabel::new(label_label, label.status); + let new_label = ForestLabel::new(label_label, label.status()); builder.set_label(node, new_label)?; } @@ -1339,7 +1339,7 @@ pub fn print_labels( let label = forest.vertex_label(node)?; if let Some(label) = label { - let label = label.label.label(); + let label = label.label().label(); match label { GrammarLabelType::TNT(tnt) => { -- cgit v1.2.3-18-g5258