From a306de0719a535fa2ffe2db1a670d1c346083d56 Mon Sep 17 00:00:00 2001 From: Sebastian Walter Date: Mon, 15 Jul 2024 15:47:54 +0200 Subject: [PATCH] adjust format --- src/grammar.rs | 2 +- text-utils-grammar/src/lr1.rs | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/grammar.rs b/src/grammar.rs index d331087..990d988 100644 --- a/src/grammar.rs +++ b/src/grammar.rs @@ -219,7 +219,7 @@ impl LR1Constraint { .ok() .and_then(|s| s.parse().ok()) .and_then(NonZeroUsize::new) - .unwrap_or(NonZeroUsize::new(8192).expect("invalid LRU cache size")); + .unwrap_or(NonZeroUsize::new(8192).unwrap()); let mut cache = LruCache::new(cache_size); cache.put(state.clone(), (indices.clone(), is_match)); Self { diff --git a/text-utils-grammar/src/lr1.rs b/text-utils-grammar/src/lr1.rs index f6f86da..750bdf9 100644 --- a/text-utils-grammar/src/lr1.rs +++ b/text-utils-grammar/src/lr1.rs @@ -1090,12 +1090,9 @@ impl Constraint for LR1GrammarConstraint { i += skip; continue; }; - let Drive::Stack(next_stack) = drive( - &self.grammar, - &self.table, - state.stack.clone(), - &tokens, - ) else { + let Drive::Stack(next_stack) = + drive(&self.grammar, &self.table, state.stack.clone(), &tokens) + else { i += skip; continue; };