Last active
August 29, 2015 14:04
-
-
Save MatejLach/ee3eff251eae0a5157c5 to your computer and use it in GitHub Desktop.
Showcases a Rust struct...
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
fn main() { | |
struct Date { | |
m: int, | |
y: int | |
} | |
let today = Date {m: 8i, y: 2014i}; | |
println!("\"August\" is the {}th month in {} (and every other year)", today.m, today.y); // access individual fields | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment