4 ms·
An alternative to `"string".to_owned() + "foo"` is just using a macro such as `concat!("string", "other string")`.
by eximius 6y ago
An alternative to `"string".to_owned() + "foo"` is just using a macro such as `concat!("string", "other string")`.
- brundolf 6y agoThat actually doesn't work in the general case, because concat!() only accepts static (compile-time) literals. i.e., this is allowed: concat!("string", "other string") but this is not: let my_str: String = ...; concat!(my_str, "other string")