From 54ab02dce2e086c945df7835fae809988dfc15a7 Mon Sep 17 00:00:00 2001 From: Enyium <123484196+Enyium@users.noreply.github.com> Date: Thu, 30 Apr 2026 22:34:38 +0200 Subject: [PATCH 1/2] docs: clarify that `SmolStr` doesn't allocate when cloning --- lib/smol_str/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/smol_str/src/lib.rs b/lib/smol_str/src/lib.rs index 55ede286c245..b76c1c7d1486 100644 --- a/lib/smol_str/src/lib.rs +++ b/lib/smol_str/src/lib.rs @@ -15,8 +15,8 @@ use core::{ /// A `SmolStr` is a string type that has the following properties: /// -/// * `size_of::() == 24` (therefor `== size_of::()` on 64 bit platforms) -/// * `Clone` is `O(1)` +/// * `size_of::() == 24` (therefore `== size_of::()` on 64 bit platforms) +/// * `Clone` is `O(1)` (no allocation) /// * Strings are stack-allocated if they are: /// * Up to 23 bytes long /// * Longer than 23 bytes, but substrings of `WS` (see below). Such strings consist From fc9cc17131eeac3373aeca8fe2f31bff12ae4a94 Mon Sep 17 00:00:00 2001 From: Enyium <123484196+Enyium@users.noreply.github.com> Date: Thu, 30 Apr 2026 22:37:07 +0200 Subject: [PATCH 2/2] docs: same in readme --- lib/smol_str/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smol_str/README.md b/lib/smol_str/README.md index 56296fb53f7d..7b52a6c5b373 100644 --- a/lib/smol_str/README.md +++ b/lib/smol_str/README.md @@ -8,7 +8,7 @@ A `SmolStr` is a string type that has the following properties: * `size_of::() == 24` (therefore `== size_of::()` on 64 bit platforms) -* `Clone` is `O(1)` +* `Clone` is `O(1)` (no allocation) * Strings are stack-allocated if they are: * Up to 23 bytes long * Longer than 23 bytes, but substrings of `WS` (see `src/lib.rs`). Such strings consist