summaryrefslogtreecommitdiff
path: root/chain/src/atom
diff options
context:
space:
mode:
Diffstat (limited to 'chain/src/atom')
-rw-r--r--chain/src/atom/default.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/chain/src/atom/default.rs b/chain/src/atom/default.rs
index 0dc24c3..14b7a9f 100644
--- a/chain/src/atom/default.rs
+++ b/chain/src/atom/default.rs
@@ -404,8 +404,9 @@ impl DefaultAtom {
.map(|(label, target_iter)| (*label, target_iter))
.collect();
- let mut terminals_map: HashMap<usize, (HashSet<(LabelType<TNT>, usize)>, bool)> =
- HashMap::new();
+ type TerminalsValue = (HashSet<(LabelType<TNT>, usize)>, bool);
+
+ let mut terminals_map: HashMap<usize, TerminalsValue> = HashMap::new();
for (label, children_iter) in children.into_iter() {
if let Some(TNT::Ter(t)) = *label.get_value() {
@@ -422,10 +423,11 @@ impl DefaultAtom {
let mut accepting = false;
for child in children_iter {
- accepting = accepting
- || *accepting_vec.get(child).ok_or_else(|| {
- GrammarError::IndexOutOfBounds(child, accepting_vec.len())
- })?;
+ accepting =
+ accepting
+ || *accepting_vec.get(child).ok_or(
+ GrammarError::IndexOutOfBounds(child, accepting_vec.len()),
+ )?;
if nt == 3
&& nfa.degree(child).map_err(index_out_of_bounds_conversion)? == 0