Skip to content

Commit

Permalink
Add document hint
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n committed Sep 14, 2024
1 parent 7f2a172 commit 8348a31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Therefore, we have created the `FastStr` type. By sacrificing immutability, we c

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

<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>

For example, if your API is something like this:

```rust
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ use core::{
use simdutf8::basic::{from_utf8, Utf8Error};

/// `FastStr` is a string type that try to avoid the cost of clone.
///
/// **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.
#[derive(Clone)]
pub struct FastStr(Repr);

Expand Down

0 comments on commit 8348a31

Please sign in to comment.