Expand description
string_more is a Rust crate that enhances the String and &str types from the standard library with powerful extension traits: StringExt and StrExt.
These traits introduce additional methods to efficiently manipulate strings, focusing on minimizing allocations by allowing in-place modifications for String and allocating when necessary for &str.
StringExt: Provides in-place operations for theStringtype, modifying the string directly without creating a new allocation.StrExt: Offers the same operations for&str, but allocates and returns a newString, leaving the original&strintact.
§Features
- In-place Operations: Modify
Stringvalues directly withStringExt, minimizing memory allocations. - Immutable Operations: Use
StrExtto perform operations on&strthat allocate and return new strings. - Flexible and Efficient: Designed to extend the standard string functionality without sacrificing performance.
Traits§
- The
EncodeUtf8trait provides a consistent interface for encoding different text-like types, making them easily interchangeable as inputs for functions requiring UTF-8 encoded data. - The
StrExttrait extends the standard library functionality for immutable string slices (&str), providing advanced string manipulation utilities. - The
StringExttrait extendsStringwith advanced in-place manipulation methods, enabling modifications without creating newStringinstances.