Hi!
The following claim is wrong:
For the most common pairs of values - &str and String, or &[u8] and Vec - this means that the entire enum is 4 words wide
Indeed, Rust performs niche optimizations for Vec and String.
This means that std::borow::Cow<str> has the same size as String (3 words).
Hi!
The following claim is wrong:
Indeed, Rust performs niche optimizations for
VecandString.This means that
std::borow::Cow<str>has the same size asString(3 words).