Closed
Description
So, imagine having a len!
macro. Literally just that.
Why is this useful?
Well, there aren't a lot of reasons...
Use-case #1:
let world = "World";
let helloworld = String::with_capacity(len!("Hello "), world.len());
println!("{}", helloworld);
Use-case #2:
let string = "prefix!!yay";
if string.starts_with("prefix!!") {
let string = &string[len!("prefix!!")..];
assert_eq!(string, "yay");
}