mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:34:57 +00:00
Remove Diagnostic::expect_range and all consumers (#20322)
Replace usage with `range().unwrap_or_default()` or more appropriate alternatives based on context.
This commit is contained in:
parent
12c337c948
commit
a3ec8ca9df
11 changed files with 53 additions and 63 deletions
|
@ -231,8 +231,12 @@ impl Workspace {
|
|||
.map(|msg| ExpandedMessage {
|
||||
code: msg.secondary_code_or_id().to_string(),
|
||||
message: msg.body().to_string(),
|
||||
start_location: source_code.line_column(msg.expect_range().start()).into(),
|
||||
end_location: source_code.line_column(msg.expect_range().end()).into(),
|
||||
start_location: source_code
|
||||
.line_column(msg.range().unwrap_or_default().start())
|
||||
.into(),
|
||||
end_location: source_code
|
||||
.line_column(msg.range().unwrap_or_default().end())
|
||||
.into(),
|
||||
fix: msg.fix().map(|fix| ExpandedFix {
|
||||
message: msg.first_help_text().map(ToString::to_string),
|
||||
edits: fix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue