The internal representation of String is `Vec<u8>`, but `vec.truncate` loops to drop members. Perhaps setting the length directly?