From 79803c47a9093e2484045f532e540f4b054e9d06 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Thu, 19 Dec 2024 13:46:55 +0100 Subject: [PATCH] style: Push single character instead of string 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)]` ``` --- src/common.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.rs b/src/common.rs index 3261df9..5fce419 100644 --- a/src/common.rs +++ b/src/common.rs @@ -219,7 +219,7 @@ fn unquote_block_string(src: &str) -> Result, Token<'_>> result.push_str(&line); for line in lines { - result.push_str("\n"); + result.push('\n'); result.push_str(&line); } }