From f61c742b7e1a785235b24c1d2700f94316462746 Mon Sep 17 00:00:00 2001 From: JasonHonKL <148705846+JasonHonKL@users.noreply.github.com> Date: Sat, 12 Jul 2025 01:58:11 +0800 Subject: [PATCH 1/2] docs --- library/alloc/src/string.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 58baa07bc1741..131a29666f3ce 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -1392,6 +1392,8 @@ impl String { /// Appends the given [`char`] to the end of this `String`. /// + /// Note: When pushing a char, it is automatically converted to its UTF-8 byte representation since Rust strings are UTF-8 encoded. + /// /// # Examples /// /// ``` From 79a52a028bb422570642555296d914d6b1a835d2 Mon Sep 17 00:00:00 2001 From: JasonHonKL <148705846+JasonHonKL@users.noreply.github.com> Date: Sat, 12 Jul 2025 10:42:32 +0800 Subject: [PATCH 2/2] Update string.rs Co-authored-by: lolbinarycat --- library/alloc/src/string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 131a29666f3ce..9085e4de47dfb 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -1392,7 +1392,7 @@ impl String { /// Appends the given [`char`] to the end of this `String`. /// - /// Note: When pushing a char, it is automatically converted to its UTF-8 byte representation since Rust strings are UTF-8 encoded. + /// Since Rust strings are UTF-8 encoded, the pushed char will automatically converted to its UTF-8 byte representation. /// /// # Examples ///