Created
April 1, 2022 02:20
-
-
Save jcar787/bfb5c135c582ede2c904e32ba71831e0 to your computer and use it in GitHub Desktop.
Struct example in Rust
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 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