Tuple structs are a thing
This commit is contained in:
parent
ea1a37f9ef
commit
389e439a47
1 changed files with 6 additions and 0 deletions
|
|
@ -6,6 +6,8 @@ struct User {
|
||||||
sign_in_count: u32,
|
sign_in_count: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct Color(i32, i32, i32);
|
||||||
|
|
||||||
fn build_user(email: String, username: String) -> User {
|
fn build_user(email: String, username: String) -> User {
|
||||||
User {
|
User {
|
||||||
email,
|
email,
|
||||||
|
|
@ -26,4 +28,8 @@ fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
println!("Hello to the User: {:?}!", user2);
|
println!("Hello to the User: {:?}!", user2);
|
||||||
|
|
||||||
|
let color = Color(1, 2, 3);
|
||||||
|
|
||||||
|
println!("Pretty colors! {}, {}, {}!", color.0, color.1, color.2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue