appendreturn

Crates.ioappendreturn
lib.rsappendreturn
version0.1.0
created_at2025-04-19 18:14:04.089677+00
updated_at2025-04-19 18:14:04.089677+00
descriptionRust's `.push_str()` method for `String` does not return the resulting value. This crate fixes that by providing a new trait method for String. Just import this crate, then call `.append_and_return()` on a String
homepagehttps://github.com/JonathanMcCormickJr/appendreturn
repositoryhttps://github.com/JonathanMcCormickJr/appendreturn
max_upload_size
id1640866
size5,071
Jonathan A. McCormick, Jr. (JonathanMcCormickJr)

documentation

https://github.com/JonathanMcCormickJr/appendreturn

README

appendreturn

This crate is for anyone who is annoyed with the fact that Rust's .push_str() method for String does not return the resulting value.

This crate is here for you. Hope this helps. ❤️

License

This software is dedicated into the public domain. See UNLICENSE for details.

Example Usage

use appendreturn::AppendReturn;
let original_value = String::from("Hello");
let additional_value = " world!!";
let combined_value = original_value.append_and_return(additional_value);
assert_eq!(combined_value, String::from("Hello world!!"));
Commit count: 5

cargo fmt