diagnostics no longer copies entire source string
This commit is contained in:
parent
1e029bd604
commit
f02bfe7b34
|
@ -66,11 +66,17 @@ impl Diagnostics {
|
|||
|
||||
let info: DebugInfo = source.clone().into();
|
||||
|
||||
let context = self.source.get(&info.origin).unwrap()
|
||||
.lines()
|
||||
.nth(info.line)
|
||||
.unwrap()
|
||||
.trim();
|
||||
|
||||
self.err = Some(DebugNotice {
|
||||
info,
|
||||
msg: message,
|
||||
ext: ext.into(),
|
||||
source: self.source.get(&info.origin).unwrap().clone(),
|
||||
source: context.to_string(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -446,10 +446,6 @@ impl std::fmt::Display for DebugNotice {
|
|||
f.write_fmt(format_args!(
|
||||
" somewhere in here:\n --> `{}`\n",
|
||||
self.source
|
||||
.lines()
|
||||
.nth(self.info.line)
|
||||
.unwrap()
|
||||
.trim()
|
||||
.bold()
|
||||
.bright_white()
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue