title: Decimal number to hexadecimal string
body: <p>Does Rust have a set of functions that make converting a decimal integer to a hexadecimal string easy? I have no trouble converting a string to an integer, but I can't seem to figure out the opposite. Currently what I have does not work (and may be a bit of an abomination)</p>
  
  <p><strong>Editor's note</strong> - this code predates Rust 1.0 and no longer compiles.</p>
  
  <pre><code>pub fn dec_to_hex_str(num: uint) -&gt; String {
      let mut result_string = String::from_str("");
      let mut i = num;
      while i / 16 &gt; 0 {
          result_string.push_str(String::from_char(1, from_digit(i / 16, 16).unwrap()).as_slice());
          i = i / 16;
      }
      result_string.push_str(String::from_char(1, from_digit(255 - i * 16, 16).unwrap()).as_slice());
  
      result_string
  }
  </code></pre>
  
  <p>Am I on the right track, or am I overthinking this whole thing?</p>