Skip to content

Instantly share code, notes, and snippets.

@jcar787
Created April 1, 2022 02:20
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 jcar787/bfb5c135c582ede2c904e32ba71831e0 to your computer and use it in GitHub Desktop.
Save jcar787/bfb5c135c582ede2c904e32ba71831e0 to your computer and use it in GitHub Desktop.
Struct example in Rust
struct Person {
name: String,
age: u8
}
fn main() {
let person = Person { name: "Jeff", age: 35 };
let name = String::from("Danny");
let age = 11;
let another_person = Person { name, person };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment