How to convert i32 to a string representing the ASCII character
<p>I'm re-doing a project in Rust this weekend and I need to convert an i32 to an ASCII character using it as the character code. All I have so far is a monstrous <code>match</code> that I'm hiding at the end of a file. Unfortunately, <code>std::ascii</code> does not support this conversion. Currently I'm just looking for a less ridiculous/more Rust-like(?) way to do this.</p>

<pre><code>fn to_ascii(i: &amp;i32) -&gt; String {
    let a = match *i {
        0 =&gt; "NUL",
        1 =&gt; "SOH",
        2 =&gt; "STX",
        // ...
        125 =&gt; "}",
        126 =&gt; "~",
        127 =&gt; "DEL",
        _ =&gt; "",
    }
    a
}
</code></pre>