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(),
|
src: raw_config.clone(),
|
||||||
named: NamedSource::new(config_path.display().to_string(), raw_config).into(),
|
named: NamedSource::new(config_path.display().to_string(), raw_config).into(),
|
||||||
// this isn't actually a legit way to get the span
|
// this isn't actually a legit way to get the span
|
||||||
location: e.line_col().map(|(line, col)| Span {
|
location: e.span().map(|range| Span {
|
||||||
start: line,
|
start: range.start,
|
||||||
end: col,
|
end: range.end,
|
||||||
}),
|
}),
|
||||||
help: e.to_string(),
|
help: e.to_string(),
|
||||||
})?;
|
})?;
|
||||||
|
|
|
@ -48,9 +48,9 @@ impl LocalPackages {
|
||||||
src: src.clone(),
|
src: src.clone(),
|
||||||
named: NamedSource::new(path.display().to_string(), src).into(),
|
named: NamedSource::new(path.display().to_string(), src).into(),
|
||||||
// this isn't actually a legit way to get the span
|
// this isn't actually a legit way to get the span
|
||||||
location: e.line_col().map(|(line, col)| Span {
|
location: e.span().map(|range| Span {
|
||||||
start: line,
|
start: range.start,
|
||||||
end: col,
|
end: range.end,
|
||||||
}),
|
}),
|
||||||
help: e.to_string(),
|
help: e.to_string(),
|
||||||
})?;
|
})?;
|
||||||
|
|
|
@ -54,9 +54,9 @@ impl Manifest {
|
||||||
src: toml.clone(),
|
src: toml.clone(),
|
||||||
named: NamedSource::new(manifest_path.display().to_string(), toml).into(),
|
named: NamedSource::new(manifest_path.display().to_string(), toml).into(),
|
||||||
// this isn't actually a legit way to get the span
|
// this isn't actually a legit way to get the span
|
||||||
location: e.line_col().map(|(line, col)| Span {
|
location: e.span().map(|range| Span {
|
||||||
start: line,
|
start: range.start,
|
||||||
end: col,
|
end: range.end,
|
||||||
}),
|
}),
|
||||||
help: e.to_string(),
|
help: e.to_string(),
|
||||||
})?;
|
})?;
|
||||||
|
|
Loading…
Reference in New Issue