Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created March 12, 2018 10:21
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/3018153f4ec84ea3062440fb81753d70 to your computer and use it in GitHub Desktop.
Save rust-play/3018153f4ec84ea3062440fb81753d70 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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