Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 4edb757

Browse files
committed
refactor: prepare to associate multiple spans with a module.
1 parent de1ac37 commit 4edb757

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'a> Parser<'a> {
113113
let result = catch_unwind(AssertUnwindSafe(|| {
114114
let mut parser = new_parser_from_file(sess.inner(), path, Some(span));
115115
match parser.parse_mod(&TokenKind::Eof) {
116-
Ok(result) => Some(result),
116+
Ok((a, i, ast::ModSpans { inner_span })) => Some((a, i, inner_span)),
117117
Err(mut e) => {
118118
e.emit();
119119
if sess.can_reset_errors() {

src/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
915915
let ident_str = rewrite_ident(&self.get_context(), ident).to_owned();
916916
self.push_str(&ident_str);
917917

918-
if let ast::ModKind::Loaded(ref items, ast::Inline::Yes, inner_span) = mod_kind {
918+
if let ast::ModKind::Loaded(ref items, ast::Inline::Yes, ast::ModSpans{ inner_span }) = mod_kind {
919919
match self.config.brace_style() {
920920
BraceStyle::AlwaysNextLine => {
921921
let indent_str = self.block_indent.to_string_with_newline(self.config);

0 commit comments

Comments
 (0)