From 6fb6f2836232fe78dce507fa899629bbefb7b449 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Mon, 10 Mar 2025 16:31:06 +1300 Subject: Make output of report_source_issue more concise Instead of displaying two locations for the same error, only show the in_merged source location if there is no in_source location. --- src/reports/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/reports/mod.rs b/src/reports/mod.rs index eb7a52f..01635b4 100644 --- a/src/reports/mod.rs +++ b/src/reports/mod.rs @@ -29,10 +29,8 @@ pub fn report_source_issue(level: LogLevel, context: &Context, message: &str) { // Format message and locations. push!("{NORMAL}\n"); - push!("{BLUE}{arrow:>w$}{NORMAL} {in_merged}\n", w=w); - if let Some(in_source) = &context.source.in_source { - push!("{BLUE}{arrow:>w$}{NORMAL} {in_source}\n", w=w); - } + let location = context.source.location(); + push!("{BLUE}{arrow:>w$}{NORMAL} {location}\n", w=w); // Format source context. let left = in_merged.start.column; -- cgit v1.2.3-70-g09d2