Skip to content

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Jun 26, 2024
1 parent 4907e45 commit 7ef78bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/ruff/src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

Expand Down
11 changes: 3 additions & 8 deletions crates/ruff_linter/src/message/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit 7ef78bd

Please sign in to comment.