Closed
Description
Hi
It seems strange that not all primitive types support TryFrom trait.
See below
#![feature(try_from)]
use std::convert::TryFrom;
fn main() {
let u: usize = TryFrom::try_from(10usize).unwrap();
let u: u16 = TryFrom::try_from(10u16).unwrap();
let b: bool = TryFrom::try_from(false).unwrap();
let f: f32 = TryFrom::try_from(1.0f32).unwrap();
let f: f64 = TryFrom::try_from(1.0).unwrap();
}
Or https://play.rust-lang.org/?gist=fdfc5e5d4bd8a7ea1a9005ab4c850373&version=nightly
Current nightly implements TryFrom only for integers(?)
bool, f32, f64 fail.
Please fix that.