How does &str
have len()
?
If str
is unsized, then how does a ref magically have a len
method? let alone an actual return value?
One could argue "unsized types cannot exist in (safe) Rust. Therefore, an str
is just an &str
stripped of its size data".
But that explanation doesn't satisfy me