Created
March 12, 2018 10:21
-
-
Save rust-play/3018153f4ec84ea3062440fb81753d70 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains 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 Test { | |
a: u32, | |
b: u32, | |
} | |
impl Test { | |
fn new(a: u32, b: u32) -> Test { | |
Test { a, b } | |
} | |
} | |
fn main() { | |
let test = Test::new(16, 12); | |
let res: u32 = test.a * test.b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment