From 5e87accfc73ae15389738bb71caf51d6c39e536e Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Thu, 29 Sep 2022 19:05:31 +0400 Subject: [PATCH] Codify `&str` -> `String` conversions in code style --- CODE_STYLE.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CODE_STYLE.md b/CODE_STYLE.md index eb0eced3..515ca25b 100644 --- a/CODE_STYLE.md +++ b/CODE_STYLE.md @@ -196,3 +196,9 @@ warn!("Everything is on fire"); ``` **Rationale:** uniformity, it's clearer which log crate is used. + +## `&str` -> `String` conversion + +Prefer using `.to_owned()`, rather than `.to_string()`, `.into()`, `String::from`, etc. + +**Rationale:** uniformity, intent clarity.