Skip to content

Commit bddfedb

Browse files
authored
[ISSUE #17]Add doc for cheetah_string mod
1 parent b1d4201 commit bddfedb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/lib.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
#![cfg_attr(not(feature = "std"), no_std)]
22

3+
//! No more relying solely on the standard library's String! CheetahString is a versatile string type that can store static strings, dynamic strings, and byte arrays.
4+
//! It is usable in both `std` and `no_std` environments. Additionally, CheetahString supports serde for serialization and deserialization.
5+
//! CheetahString also supports the `bytes` feature, allowing conversion to the `bytes::Bytes` type.
6+
//! This reduces memory allocations during cloning, enhancing performance.
7+
//! example:
8+
//! ```rust
9+
//! use cheetah_string::CheetahString;
10+
//!
11+
//!
12+
//! let s = CheetahString::from("Hello, world!");
13+
//!
14+
//! let s2:&'static str = "Hello, world!";
15+
//! let s3 = CheetahString::from_static_str(s2);
16+
//!
17+
//! let s4 = CheetahString::new();
18+
//!
19+
//! ```
20+
//!
321
mod cheetah_string;
422

523
#[cfg(feature = "serde")]

0 commit comments

Comments
 (0)