fn longest2<'lifetime>(x: &'lifetime str, y: &'lifetime str) -> &'lifetime str {
    if x.len() > y.len() {
        x
    } else {
        y
    }
}
// with this x and y have same life time in function
// both x and y will stay until each last return called
// usually use 'a but using 'lifetime more easy understand
with this x and y have same life time in function
both x and y will stay until each last return called
usually use 'a but using 'lifetime more easy understand
with this x and y have same life time in function both x and y will stay until each last return called usually use ' a but using ' lifetime more easy understand
fn longest2<'lifetime>(x: &'lifetime str, y: &'lifetime str) -> &'lifetime str {
    if x.len() > y.len() {
        x
    } else {
        y
    }
}
fn longest2 < ' lifetime > ( x : & ' lifetime str , y : & ' lifetime str ) -> & ' lifetime str { if x . len ( ) > y . len ( ) { x } else { y } }
with this x and y have same life time in function
both x and y will stay until each last return called
usually use 'a but using 'lifetime more easy understand
with this x and y have same life time in function both x and y will stay until each last return called usually use ' a but using ' lifetime more easy understand
x
&'lifetime str
y
&'lifetime str
x
&'lifetime str
y
&'lifetime str