| Crates.io | appendreturn |
| lib.rs | appendreturn |
| version | 0.1.0 |
| created_at | 2025-04-19 18:14:04.089677+00 |
| updated_at | 2025-04-19 18:14:04.089677+00 |
| description | Rust'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 |
| homepage | https://github.com/JonathanMcCormickJr/appendreturn |
| repository | https://github.com/JonathanMcCormickJr/appendreturn |
| max_upload_size | |
| id | 1640866 |
| size | 5,071 |
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. ❤️
This software is dedicated into the public domain. See UNLICENSE for details.
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!!"));