Created
February 25, 2020 08:15
-
-
Save ruimo/f84cefb82846523473b4ea075a6d5d22 to your computer and use it in GitHub Desktop.
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 longer(s0: &String, s1: &String) -> String { | |
if s0.len() > s1.len() { | |
s0.to_string() | |
} else { | |
s1.to_string() | |
} | |
} | |
fn main() { | |
let s0 = "Hi"; | |
let s1 = "Low"; | |
println!( | |
"longer: {}", | |
longer(&s0.to_string(), &s1.to_string()) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment