diff --git a/crates/ruff/src/printer.rs b/crates/ruff/src/printer.rs index f7403566ba6a0c..588b9e179a6869 100644 --- a/crates/ruff/src/printer.rs +++ b/crates/ruff/src/printer.rs @@ -80,7 +80,7 @@ impl Serialize for SerializeMessageKindAsTitle { impl Display for SerializeMessageKindAsTitle { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.0.as_str()) + f.write_str(self.0.as_str()) } } diff --git a/crates/ruff_linter/src/message/github.rs b/crates/ruff_linter/src/message/github.rs index 972e02475813eb..9fd0a5ee6b912a 100644 --- a/crates/ruff_linter/src/message/github.rs +++ b/crates/ruff_linter/src/message/github.rs @@ -49,15 +49,10 @@ impl Emitter for GithubEmitter { )?; if let Some(rule) = message.rule() { - writeln!( - writer, - " {code} {body}", - code = rule.noqa_code(), - body = message.body() - )?; - } else { - writeln!(writer, " {}", message.body())?; + write!(writer, " {}", rule.noqa_code())?; } + + writeln!(writer, " {}", message.body())?; } Ok(())