This `unsafe` is unnecessary. Assuming your problem is `s` is borrowing `self` and you need to mutate other fields of `self`, you can just destruct it.

```rust
let UnescapeWriter { ref buf, ref mut pos, ref state, ref mut dest } = *self;
let s = buf.slice_to(*pos);
*pos = 0;
...
`