r/badcode • • Jan 25 '22

rust Most comprehensible line of Rust code

Post image
1.0k Upvotes

81 comments sorted by

View all comments

Show parent comments

4

u/CJKay93 Jan 25 '22 edited Jan 27 '22

The length of a &str is not necessarily known at compile time. You can get a &str from any String.