Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created January 24, 2020 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/7ccaac6b4b1e1e0332b6b59fe89dd218 to your computer and use it in GitHub Desktop.
Save rust-play/7ccaac6b4b1e1e0332b6b59fe89dd218 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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