title: Parse vector into correct types
body: <p>Is there a way to convert a <code>String</code> to some other type dynamically? I have a vector of values in the format <code>key:type:value</code> that I'd like to convert to key value pairs where the value has been converted to the correct type. In this case the types map as: <code>i=i64</code>, and <code>f=f64</code>.</p>
  
  <p>So far I have this:</p>
  
  <pre class="lang-rust prettyprint-override"><code>fn main() {
      let arr: Vec&lt;String&gt; = vec!["A:i:49".to_string(), "B:f:0.1374".to_string()];
  
      let tup: Vec&lt;_&gt; = arr
          .iter()
          .map(|s| s.split(":").collect::&lt;Vec&lt;&amp;str&gt;&gt;())
          .collect();
  
      println!("Arr: {:#?}", arr);
      println!("Tup: {:?}", tup)
  }
  
  // Arr: [
  //     "A:i:49",
  //     "B:f:0.1374",
  // ]
  // Tup: [["A", "i", "49"], ["B", "f", "0.1374"]]
  </code></pre>
  
  <p>Looking to acheive something like:</p>
  
  <pre><code>[("A", 49), ("B", 0.1374)]
  </code></pre>
  
  <p>I've looked at generics/implementations but cannot work out what to do.</p>
  
  <p>Note: any vec may have any key, so the next set could be <code>["A:i:99", "C:i:0"]</code>, types are limited to integers, floats, and strings.</p>