Crate appendreturn

Crate appendreturn 

Source
Expand 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 like so.

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!!"));

Traits§

AppendReturn