mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:24 +00:00
Write diagnostic name when failing to create fix (#4309)
This commit is contained in:
parent
f08fd5cbf0
commit
318653c427
1 changed files with 2 additions and 2 deletions
|
@ -65,7 +65,7 @@ impl Diagnostic {
|
||||||
pub fn try_set_fix(&mut self, func: impl FnOnce() -> Result<Fix>) {
|
pub fn try_set_fix(&mut self, func: impl FnOnce() -> Result<Fix>) {
|
||||||
match func() {
|
match func() {
|
||||||
Ok(fix) => self.fix = Some(fix),
|
Ok(fix) => self.fix = Some(fix),
|
||||||
Err(err) => error!("Failed to create fix: {}", err),
|
Err(err) => error!("Failed to create fix for {}: {}", self.kind.name, err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ impl Diagnostic {
|
||||||
pub fn try_set_fix_from_edit(&mut self, func: impl FnOnce() -> Result<Edit>) {
|
pub fn try_set_fix_from_edit(&mut self, func: impl FnOnce() -> Result<Edit>) {
|
||||||
match func() {
|
match func() {
|
||||||
Ok(edit) => self.fix = Some(Fix::unspecified(edit)),
|
Ok(edit) => self.fix = Some(Fix::unspecified(edit)),
|
||||||
Err(err) => error!("Failed to create fix: {}", err),
|
Err(err) => error!("Failed to create fix for {}: {}", self.kind.name, err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue