From 389e439a47f1a9df83e9c5f0bd1b972e05a91fa2 Mon Sep 17 00:00:00 2001 From: laurens Date: Fri, 22 May 2020 13:47:13 +0200 Subject: [PATCH] Tuple structs are a thing --- struct_example/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/struct_example/src/main.rs b/struct_example/src/main.rs index 9f7b9af..1c09b13 100644 --- a/struct_example/src/main.rs +++ b/struct_example/src/main.rs @@ -6,6 +6,8 @@ struct User { sign_in_count: u32, } +struct Color(i32, i32, i32); + fn build_user(email: String, username: String) -> User { User { email, @@ -26,4 +28,8 @@ fn main() { }; println!("Hello to the User: {:?}!", user2); + + let color = Color(1, 2, 3); + + println!("Pretty colors! {}, {}, {}!", color.0, color.1, color.2); }