Skip to content

Commit 97d7e1a

Browse files
committed
[assembler] Eliminate redundant forwarding function.
1 parent a406711 commit 97d7e1a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

assembler/src/asmlib/lexer.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -969,10 +969,6 @@ impl<'a> Lexer<'a> {
969969
self.adjust_span(self.lower.span())
970970
}
971971

972-
fn next_upper(upper: &mut GlyphTokenizer<'a>) -> Option<(Token, Span)> {
973-
upper.get_next_spanned_token()
974-
}
975-
976972
pub(crate) fn spanned(&self) -> SpannedIter<'a> {
977973
let lexer: Lexer<'a> = self.clone();
978974
SpannedIter::new(lexer)
@@ -981,7 +977,7 @@ impl<'a> Lexer<'a> {
981977
fn get_next(&mut self) -> Option<Token> {
982978
use lower::Lexeme;
983979
if let Some(upper_lexer) = self.upper.as_mut() {
984-
match Lexer::next_upper(upper_lexer) {
980+
match upper_lexer.get_next_spanned_token() {
985981
Some((r, span)) => {
986982
self.upper_span = Some(span);
987983
return Some(r);
@@ -1002,11 +998,12 @@ impl<'a> Lexer<'a> {
1002998
Lexeme::Text(text) => {
1003999
let upper = GlyphTokenizer::new(text);
10041000
self.upper = Some(upper);
1005-
match Lexer::next_upper(
1006-
self.upper
1007-
.as_mut()
1008-
.expect("the option cannot be empty, we just filled it"),
1009-
) {
1001+
match self
1002+
.upper
1003+
.as_mut()
1004+
.expect("the option cannot be empty, we just filled it")
1005+
.get_next_spanned_token()
1006+
{
10101007
Some((r, span)) => {
10111008
self.upper_span = Some(span);
10121009
Some(r)

0 commit comments

Comments
 (0)