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