Skip to content

Commit

Permalink
[ISSUE #17]Add doc for cheetah_string mod (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsm authored Nov 7, 2024
1 parent b1d4201 commit 9934a66
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#![cfg_attr(not(feature = "std"), no_std)]

//! 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.
//! It is usable in both `std` and `no_std` environments. Additionally, CheetahString supports serde for serialization and deserialization.
//! CheetahString also supports the `bytes` feature, allowing conversion to the `bytes::Bytes` type.
//! This reduces memory allocations during cloning, enhancing performance.
//! example:
//! ```rust
//! use cheetah_string::CheetahString;
//!
//!
//! let s = CheetahString::from("Hello, world!");
//!
//! let s2:&'static str = "Hello, world!";
//! let s3 = CheetahString::from_static_str(s2);
//!
//! let s4 = CheetahString::new();
//!
//! ```
//!
mod cheetah_string;

#[cfg(feature = "serde")]
Expand Down

0 comments on commit 9934a66

Please sign in to comment.