From 05f130692ebeea7bd37584bc00f4d7244d34212e Mon Sep 17 00:00:00 2001 From: Sil Klaasboer Date: Sat, 20 Dec 2025 15:45:52 +0100 Subject: [PATCH] add structs --- containers/src/main.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/containers/src/main.rs b/containers/src/main.rs index 7661ff4..0706332 100644 --- a/containers/src/main.rs +++ b/containers/src/main.rs @@ -12,6 +12,12 @@ enum Status Failed(String) } +struct RGB +{ + red: i32, + green: i32, + blue: i32, +} fn main() { // normal Enum let direction = Direction::Down; @@ -29,4 +35,10 @@ fn main() { Status::Succeeded(message) => println!("Succeeded with msg: {}",message), Status::Failed(message) => println!("Failed with msg: {}",message), } -} + + // struct + let color = RGB{red:255,green:255,blue:255}; + println!("color has R:{} G:{} B:{}",color.red,color.green,color.blue); + + +} \ No newline at end of file