diff --git a/compiler/mono/src/decision_tree.rs b/compiler/mono/src/decision_tree.rs index e4fb09c041..ab759d4d3d 100644 --- a/compiler/mono/src/decision_tree.rs +++ b/compiler/mono/src/decision_tree.rs @@ -132,17 +132,6 @@ impl<'a> Hash for Test<'a> { } } -#[derive(Clone, Debug, PartialEq)] -pub enum Path { - Index { - index: u64, - tag_id: u8, - path: Box, - }, - Unbox(Box), - Empty, -} - // ACTUALLY BUILD DECISION TREES #[derive(Clone, Debug, PartialEq)] @@ -237,7 +226,7 @@ fn flatten<'a>( { // TODO ^ do we need to check that guard.is_none() here? - let mut path = path_pattern.0; + let path = path_pattern.0; // Theory: unbox doesn't have any value for us, because one-element tag unions // don't store the tag anyway. if arguments.len() == 1 { @@ -984,34 +973,6 @@ pub struct PathInstruction { tag_id: u8, } -fn reverse_path(mut path: &Path) -> Vec { - let mut result = Vec::new(); - - loop { - match path { - Path::Unbox(nested) => { - path = nested; - } - Path::Empty => break, - Path::Index { - index, - tag_id, - path: nested, - } => { - result.push(PathInstruction { - index: *index, - tag_id: *tag_id, - }); - path = nested; - } - } - } - - result.reverse(); - - result -} - fn path_to_expr_help<'a>( env: &mut Env<'a, '_>, mut symbol: Symbol,