style(xatu): simplify diagnostic formatting
This commit is contained in:
@@ -19,14 +19,12 @@ pub struct Diagnostic {
|
|||||||
|
|
||||||
impl std::fmt::Display for Diagnostic {
|
impl std::fmt::Display for Diagnostic {
|
||||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
write!(
|
let start = self.finding.range.start;
|
||||||
formatter,
|
let end = self.finding.range.end;
|
||||||
"{}..{}: {}: {}",
|
let rule_id = self.finding.rule_id;
|
||||||
self.finding.range.start,
|
let message = self.finding.message;
|
||||||
self.finding.range.end,
|
|
||||||
self.finding.rule_id,
|
write!(formatter, "{start}..{end}: {rule_id}: {message}")
|
||||||
self.finding.message,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user