Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created January 24, 2020 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/cf5d626100f5c09993b720f31710bc43 to your computer and use it in GitHub Desktop.
Save rust-play/cf5d626100f5c09993b720f31710bc43 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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