Skip to content

Commit 3457487

Browse files
authored
chore: cast &last_node to &dyn Spanned (#314)
1 parent 6ec15e9 commit 3457487

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/parsing/parser.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6037,12 +6037,7 @@ fn parse_statements<'a>(inner_span: Span, stmts: Vec<Node<'a>>, context: &mut Co
60376037
let last_comment = comments.iter().filter(|c| !context.has_handled_comment(c)).last().map(|c| c.span);
60386038
items.extend(parse_comments_as_statements(
60396039
comments.into_iter(),
6040-
if let Some(last_node) = &last_node {
6041-
// todo: why can't I just use .as_ref() here?
6042-
Some(last_node)
6043-
} else {
6044-
None
6045-
},
6040+
last_node.as_ref().map(|x| x as &dyn Spanned),
60466041
context,
60476042
));
60486043
last_node = last_comment.or(last_node);

0 commit comments

Comments
 (0)