|
|
@ -98,9 +98,7 @@ fn main() {
|
|
|
|
let result = longest(string1.as_str(), string2);
|
|
|
|
let result = longest(string1.as_str(), string2);
|
|
|
|
println!("The longest string is {}", result);
|
|
|
|
println!("The longest string is {}", result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```rust
|
|
|
|
|
|
|
|
fn longest(x: &str, y: &str) -> &str {
|
|
|
|
fn longest(x: &str, y: &str) -> &str {
|
|
|
|
if x.len() > y.len() {
|
|
|
|
if x.len() > y.len() {
|
|
|
|
x
|
|
|
|
x
|
|
|
|