Created
January 24, 2020 15:27
-
-
Save rust-play/cf5d626100f5c09993b720f31710bc43 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Int32(i32); | |
struct Int64(i64); | |
pub trait Num { | |
fn new() -> Self; | |
} | |
impl Num for Int32 { | |
fn new() -> Self { Int32(0) } | |
} | |
impl Num for Int64 { | |
fn new() -> Self { Int64(0) } | |
} | |
fn main() { | |
let i_32 = Num::new(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment