Skip to content

Instantly share code, notes, and snippets.

@metajack
Forked from rust-play/playground.rs
Created April 24, 2018 04:54
Show Gist options
  • Save metajack/30167a69509789ccf4a6d186eebeca54 to your computer and use it in GitHub Desktop.
Save metajack/30167a69509789ccf4a6d186eebeca54 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
fn log(msg: &String) {
println!("{}", msg);
}
fn main() {
let s = String::from("this is a log message");
log(&s);
println!("length is {}", s.len());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment