Skip to content

0.4.0

Latest

Choose a tag to compare

@ThisAccountHasBeenSuspended ThisAccountHasBeenSuspended released this 14 Nov 01:03
  • Documentation and descriptions improved.
  • is_empty added.
    • Short version of example.size() == 0.
    • Can be used to improve code readability.
  • Generic for replace_with and push added.
    • You can now pass &[u8], Vec<u8>, &str, String and others as values if the trait AsRef<[u8]> is supported.
  • impl From<&[u8]> added.
    • You can now also use slices to create a new mutstr.
  • impl AsRef<[u8]>, impl AsMut<[u8]>, impl AsRef<str>, impl AsMut<str> added.
    • Can be needed in many situations, just like we use it in replace_with and push with AsRef<[u8]> now.
    • For example, you can now also pass other mutstr variables in push and replace_with as a value. (SEE EXAMPLE 1)

EXAMPLE 1

fn main() {
    let mut first = mutstr::default();
    let second = mutstr::from("test");
    first.push(second); // You can also use a reference to second
    assert_eq!(first.as_str(), "test");
}