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/05bc48db5d6ecd2aa261a4cd4b1a4693 to your computer and use it in GitHub Desktop.
Save rust-play/05bc48db5d6ecd2aa261a4cd4b1a4693 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