Unnamed repository; edit this file 'description' to name the repository.
Clarify size of SmolStr better
Lukas Wirth 2023-03-31
parent 8f9fefd · commit 4ad02f7
-rw-r--r--lib/smol_str/README.md2
-rw-r--r--lib/smol_str/src/lib.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/smol_str/README.md b/lib/smol_str/README.md
index 0cc1910181..610726a216 100644
--- a/lib/smol_str/README.md
+++ b/lib/smol_str/README.md
@@ -7,7 +7,7 @@
A `SmolStr` is a string type that has the following properties:
-* `size_of::<SmolStr>() == size_of::<String>()`
+* `size_of::<SmolStr>() == 24 (therefor == size_of::<String>() on 64 bit platforms)
* `Clone` is `O(1)`
* Strings are stack-allocated if they are:
* Up to 23 bytes long
diff --git a/lib/smol_str/src/lib.rs b/lib/smol_str/src/lib.rs
index a67a7fc096..91dc6252cc 100644
--- a/lib/smol_str/src/lib.rs
+++ b/lib/smol_str/src/lib.rs
@@ -19,7 +19,7 @@ use core::{
/// A `SmolStr` is a string type that has the following properties:
///
-/// * `size_of::<SmolStr>() == size_of::<String>()`
+/// * `size_of::<SmolStr>() == 24 (therefor == size_of::<String>() on 64 bit platforms)
/// * `Clone` is `O(1)`
/// * Strings are stack-allocated if they are:
/// * Up to 23 bytes long