This entire function is equivalent to

```rust
fn escape_char(c: char, f: |char|) {
    match c {
        // don't escape \
        '\\' => f(c),
        _ => c.escape_default(f)
    }
}
```

And if you do escape backslashes, as I'm inclined to think you should, then this function can be deleted entirely in favor of `c.escape_default(f)`.