Skip to content

Instantly share code, notes, and snippets.

@MatejLach
Last active August 29, 2015 14:04
Show Gist options
  • Save MatejLach/ee3eff251eae0a5157c5 to your computer and use it in GitHub Desktop.
Save MatejLach/ee3eff251eae0a5157c5 to your computer and use it in GitHub Desktop.
Showcases a Rust struct...
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