You can't without some allocation, which means you will end up with a String
.
let s2: String = s.iter().collect();
The problem is that strings in Rust are not collections of char
s, they are UTF-8, which is an encoding without a fixed size per character.
For example, the array…
Top comments (0)