diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-09-29 00:10:39 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-09-29 00:10:39 +0200 |
| commit | 989d344d3dc2e08ec2ed5025b202e464a5b29d2c (patch) | |
| tree | 998fc65fe8e836b51658476a7af1ec77009dd922 /src/main.rs | |
| parent | a0065eef86685223a1bbb2f586036f7df5b36349 (diff) | |
Implement `Display` for `Tracepoint`
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs index 38a37bde..55f83cd7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ use codespan_reporting::term::{self, termcolor, Config, Styles}; use same_file::is_same_file; use termcolor::{ColorChoice, StandardStream, WriteColor}; -use typst::diag::{Error, Tracepoint}; +use typst::diag::Error; use typst::source::SourceStore; fn main() { @@ -136,14 +136,7 @@ fn print_diagnostics( // Stacktrace-like helper diagnostics. for point in error.trace { - let message = match point.v { - Tracepoint::Call(Some(name)) => { - format!("error occured in this call of function `{}`", name) - } - Tracepoint::Call(None) => "error occured in this function call".into(), - Tracepoint::Import => "error occured while importing this module".into(), - }; - + let message = point.v.to_string(); let help = Diagnostic::help().with_message(message).with_labels(vec![ Label::primary(point.span.source, point.span.to_range()), ]); |
