Crate string_more

Source
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 the String type, modifying the string directly without creating a new allocation.
  • StrExt: Offers the same operations for &str, but allocates and returns a new String, leaving the original &str intact.

§Features

  • In-place Operations: Modify String values directly with StringExt, minimizing memory allocations.
  • Immutable Operations: Use StrExt to perform operations on &str that allocate and return new strings.
  • Flexible and Efficient: Designed to extend the standard string functionality without sacrificing performance.

Traits§

EncodeUtf8
The EncodeUtf8 trait provides a consistent interface for encoding different text-like types, making them easily interchangeable as inputs for functions requiring UTF-8 encoded data.
StrExt
The StrExt trait extends the standard library functionality for immutable string slices (&str), providing advanced string manipulation utilities.
StringExt
The StringExt trait extends String with advanced in-place manipulation methods, enabling modifications without creating new String instances.