mem::transmute documentation says that this copies the bytes.
But I find it hard to believe that
as_bytes, which is used everywhere, include
str.len, would be so involved. Further, a simple test shows that if you mutate the returned bytes, the original string is mutated.
So, either I'm misunderstanding
mem::transmute's documentation, or I'm missing something very obvious.