From d739181a768f7bee159dfd6556b64783034361a4 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 3 Dec 2024 18:47:03 +0200 Subject: [PATCH] use to_string method --- src/line/code/multiline.rs | 2 +- src/line/quote.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/line/code/multiline.rs b/src/line/code/multiline.rs index 4275d5b..2662a94 100644 --- a/src/line/code/multiline.rs +++ b/src/line/code/multiline.rs @@ -25,7 +25,7 @@ impl Multiline { return Some(Self { alt: match alt.is_empty() { true => None, - false => Some(String::from(alt)), + false => Some(alt.to_string()), }, value: String::new(), completed: false, diff --git a/src/line/quote.rs b/src/line/quote.rs index c85cdd1..9434305 100644 --- a/src/line/quote.rs +++ b/src/line/quote.rs @@ -19,11 +19,9 @@ impl Quote { ); // Detect value - let value = regex.get(1)?.trim(); + let value = regex.get(1)?.trim().to_string(); // Result - Some(Self { - value: String::from(value), - }) + Some(Self { value }) } }