Created
October 24, 2024 11:51
-
-
Save masiarek/2912e69ec75b7b3bd3986b350932108a to your computer and use it in GitHub Desktop.
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 characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment