summaryrefslogtreecommitdiffstats
path: root/vendor/pest_meta/src/optimizer/restorer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/pest_meta/src/optimizer/restorer.rs')
-rw-r--r--vendor/pest_meta/src/optimizer/restorer.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/vendor/pest_meta/src/optimizer/restorer.rs b/vendor/pest_meta/src/optimizer/restorer.rs
index 34a710eab..e128e03f1 100644
--- a/vendor/pest_meta/src/optimizer/restorer.rs
+++ b/vendor/pest_meta/src/optimizer/restorer.rs
@@ -8,19 +8,15 @@
// modified, or distributed except according to those terms.
use std::collections::HashMap;
-use optimizer::*;
+use crate::optimizer::*;
pub fn restore_on_err(
rule: OptimizedRule,
rules: &HashMap<String, OptimizedExpr>,
) -> OptimizedRule {
- match rule {
- OptimizedRule { name, ty, expr } => {
- let expr = expr.map_bottom_up(|expr| wrap_branching_exprs(expr, rules));
-
- OptimizedRule { name, ty, expr }
- }
- }
+ let OptimizedRule { name, ty, expr } = rule;
+ let expr = expr.map_bottom_up(|expr| wrap_branching_exprs(expr, rules));
+ OptimizedRule { name, ty, expr }
}
fn wrap_branching_exprs(
@@ -96,7 +92,7 @@ fn child_modifies_state(
#[cfg(test)]
mod tests {
use super::*;
- use optimizer::OptimizedExpr::*;
+ use crate::optimizer::OptimizedExpr::*;
#[test]
fn restore_no_stack_children() {