Compare commits
1 Commits
with-lifet
...
no-lifetim
Author | SHA1 | Date | |
---|---|---|---|
|
3dd76c0dfd |
@@ -6,11 +6,7 @@ fn main() {
|
||||
println!("The longest string is {result}");
|
||||
}
|
||||
|
||||
fn longest<'a, 'b, 'out>(a: &'a str, b: &'b str) -> &'out str
|
||||
where
|
||||
'a: 'out,
|
||||
'b: 'out,
|
||||
{
|
||||
fn longest(a: &str, b: &str) -> &str {
|
||||
if a.len() > b.len() {
|
||||
a
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user