Created
October 24, 2024 11:51
-
-
Save masiarek/2912e69ec75b7b3bd3986b350932108a to your computer and use it in GitHub Desktop.
Revisions
-
masiarek created this gist
Oct 24, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ struct Feelings { flag1: bool, flag2: bool, } impl Feelings { fn feel_good(&self) -> bool { self.flag1 } } fn feel() -> Feelings { Feelings { flag1: true, flag2: false, } } fn main() { let f = Feelings { flag1: true, flag2: false, }; println!("Feelings: {:?}", f.flag1); let f2 = feel(); println!("Feelings: {:?}", f2.flag1); }