Skip to content

Commit 7df8303

Browse files
authored
Add document for memory size (#20)
1 parent 7f2a172 commit 7df8303

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Therefore, we have created the `FastStr` type. By sacrificing immutability, we c
3232

3333
`FastStr` implements `From` trait for various types, so you can easily migrate to `FastStr` by replacing `String` with `FastStr` and adding `.into()`.
3434

35+
<sub> **Note:** The memory size of `FastStr` is not `24`, so switching from `String` or [`SmolStr`](https://docs.rs/smol_str/latest/smol_str/struct.SmolStr.html) to `FastStr` may not be harmless.</sub>
36+
3537
For example, if your API is something like this:
3638

3739
```rust

src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ use core::{
1616
use simdutf8::basic::{from_utf8, Utf8Error};
1717

1818
/// `FastStr` is a string type that try to avoid the cost of clone.
19+
///
20+
/// **Note:** The memory size of `FastStr` is not `24`, so switching from [`String`] or [`SmolStr`](https://docs.rs/smol_str/latest/smol_str/struct.SmolStr.html) to `FastStr` may not be harmless.
1921
#[derive(Clone)]
2022
pub struct FastStr(Repr);
2123

0 commit comments

Comments
 (0)