This would look something like

```rust
loop {
    let (i,b) = match iter.next() {
        None => break,
        Some(x) => x
    };
    if b == '&' as u8 {
        if last < i { try!(fmt.buf.write(pile_o_bits.slice(last, i).as_bytes())); }
        try!(fmt.buf.write(unescape_entity(iter).as_slice()));
    }
}
```

(where `unescape_entity()` is changed to just return `MaybeOwned`).