Skip to content

Instantly share code, notes, and snippets.

@masiarek
Created October 24, 2024 11:51
Show Gist options
  • Save masiarek/2912e69ec75b7b3bd3986b350932108a to your computer and use it in GitHub Desktop.
Save masiarek/2912e69ec75b7b3bd3986b350932108a to your computer and use it in GitHub Desktop.
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