use newtype_ops::newtype_ops;
#[derive(PartialEq, Clone, Debug)]
pub struct MyString(String);
newtype_ops! { [MyString] {add} {:=} ^Self &{Self str} }
#[test]
fn test() {
assert_eq!(
MyString("Hello world".to_string()) + "!",
MyString("Hello world!".to_string())
)
}
#[cfg(nope)] #[test]
fn victim() {
let mut s = MyString("Hello world".to_string());
s += "!";
assert_eq!(s, MyString("Hello world!".to_string()));
}