Simplified example with lifetimes specified
This commit is contained in:
		@@ -6,11 +6,7 @@ fn main() {
 | 
				
			|||||||
    println!("The longest string is {result}");
 | 
					    println!("The longest string is {result}");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn longest<'a, 'b, 'out>(a: &'a str, b: &'b str) -> &'out str
 | 
					fn longest<'a>(a: &'a str, b: &'a str) -> &'a str {
 | 
				
			||||||
where
 | 
					 | 
				
			||||||
    'a: 'out,
 | 
					 | 
				
			||||||
    'b: 'out,
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    if a.len() > b.len() {
 | 
					    if a.len() > b.len() {
 | 
				
			||||||
        a
 | 
					        a
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user