Created
October 17, 2019 22:47
-
-
Save rust-play/6c058b34de33bd7caae4ee0a6f53c68b 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
fn main() { | |
let s = String::from("World"); | |
let s2 = foo(s); | |
println!("{}", s); | |
} | |
fn foo(s: String) -> String { | |
let mut s1 = String::from(", Hello!"); | |
s1.push_str(s.as_str()); | |
s1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment