Crates.io | cast_trait |
lib.rs | cast_trait |
version | 0.1.2 |
source | src |
created_at | 2018-04-10 00:27:33.446744 |
updated_at | 2018-04-29 22:13:48.238666 |
description | cast trait |
homepage | https://gitlab.com/nathanfaucett/rs-cast_trait |
repository | https://gitlab.com/nathanfaucett/rs-cast_trait.git |
max_upload_size | |
id | 59802 |
size | 7,645 |
cast trait
use cast_trait::Cast;
fn cast<A, B>(a: A) -> B
where A: Cast<B>,
{
a.cast()
}
assert_eq!(cast::<i32, f32>(10_i32), 10_f32);