-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
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");
}
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.