Created
January 24, 2020 13:14
-
-
Save rust-play/7ccaac6b4b1e1e0332b6b59fe89dd218 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains 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 Greeter { | |
name: String, | |
} | |
impl Greeter { | |
fn greet(&self) { | |
println!("Hey, {}!", self.name); | |
} | |
} | |
fn main() { | |
let greeter = Greeter { | |
name: "Xanatos".to_owned(), | |
}; | |
greeter.greet(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment