Skip to content

Commit

Permalink
style: Push single character instead of string
Browse files Browse the repository at this point in the history
This solves clippy warnings like this:
```
error: calling `push_str()` using a single-character string literal
   --> src/common.rs:222:13
    |
222 |             result.push_str("\n");
    |             ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `result.push('\n')`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
    = note: `-D clippy::single-char-add-str` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::single_char_add_str)]`
```
  • Loading branch information
caspermeijn committed Dec 19, 2024
1 parent 4eb2275 commit 79803c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ fn unquote_block_string(src: &str) -> Result<String, Error<Token<'_>, Token<'_>>
result.push_str(&line);

for line in lines {
result.push_str("\n");
result.push('\n');
result.push_str(&line);
}
}
Expand Down

0 comments on commit 79803c4

Please sign in to comment.