Skip to content

Commit

Permalink
cleanup: unreachables and unused
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhrzg committed Dec 12, 2024
1 parent f1bb7fa commit aa73c93
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/dfa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ pub(crate) trait ScopeExt: Sized {
f(self);
self
}

fn drop(self) {}
}

impl<Any: Sized> ScopeExt for Any {}
Expand Down
1 change: 0 additions & 1 deletion src/error_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,6 @@ impl<'input, Ctx: ParserNodeType<'input>> BailErrorStrategy<'input, Ctx> {
ctx.set_exception(e.clone());
ctx = ctx.get_parent()?
}
Some(())
})();
return ANTLRError::FallThrough(Rc::new(ParseCancelledError(e.clone())));
}
Expand Down
8 changes: 4 additions & 4 deletions src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<'input, Node: ParserNodeType<'input>, T: 'static> CustomRuleContext<'input>
usize::max_value()
}

fn get_node_text(&self, rule_names: &[&str]) -> String {
fn get_node_text(&self, _rule_names: &[&str]) -> String {
self.symbol.borrow().get_text().to_display()
}
}
Expand Down Expand Up @@ -289,14 +289,14 @@ pub trait ParseTreeVisitorCompat<'input>: VisitChildren<'input, Self::Node> {
return result;
}

fn aggregate_results(&self, aggregate: Self::Return, next: Self::Return) -> Self::Return {
fn aggregate_results(&self, _aggregate: Self::Return, next: Self::Return) -> Self::Return {
next
}

fn should_visit_next_child(
&self,
node: &<Self::Node as ParserNodeType<'input>>::Type,
current: &Self::Return,
_node: &<Self::Node as ParserNodeType<'input>>::Type,
_current: &Self::Return,
) -> bool {
true
}
Expand Down
2 changes: 0 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ pub fn escape_whitespaces(data: impl Borrow<str>, escape_spaces: bool) -> String
res
}

pub trait Sealed {}

pub fn cell_update<T: Copy, F>(cell: &Cell<T>, f: F) -> T
where
F: FnOnce(T) -> T,
Expand Down

0 comments on commit aa73c93

Please sign in to comment.