fix: toml now have a better way to capture error spans
This commit is contained in:
parent
92161bed43
commit
79c2cb3062
|
@ -88,9 +88,9 @@ impl Config {
|
|||
src: raw_config.clone(),
|
||||
named: NamedSource::new(config_path.display().to_string(), raw_config).into(),
|
||||
// this isn't actually a legit way to get the span
|
||||
location: e.line_col().map(|(line, col)| Span {
|
||||
start: line,
|
||||
end: col,
|
||||
location: e.span().map(|range| Span {
|
||||
start: range.start,
|
||||
end: range.end,
|
||||
}),
|
||||
help: e.to_string(),
|
||||
})?;
|
||||
|
|
|
@ -48,9 +48,9 @@ impl LocalPackages {
|
|||
src: src.clone(),
|
||||
named: NamedSource::new(path.display().to_string(), src).into(),
|
||||
// this isn't actually a legit way to get the span
|
||||
location: e.line_col().map(|(line, col)| Span {
|
||||
start: line,
|
||||
end: col,
|
||||
location: e.span().map(|range| Span {
|
||||
start: range.start,
|
||||
end: range.end,
|
||||
}),
|
||||
help: e.to_string(),
|
||||
})?;
|
||||
|
|
|
@ -54,9 +54,9 @@ impl Manifest {
|
|||
src: toml.clone(),
|
||||
named: NamedSource::new(manifest_path.display().to_string(), toml).into(),
|
||||
// this isn't actually a legit way to get the span
|
||||
location: e.line_col().map(|(line, col)| Span {
|
||||
start: line,
|
||||
end: col,
|
||||
location: e.span().map(|range| Span {
|
||||
start: range.start,
|
||||
end: range.end,
|
||||
}),
|
||||
help: e.to_string(),
|
||||
})?;
|
||||
|
|
Loading…
Reference in New Issue