Returning a new lifetime vs returning 'static lifetime
The Rust Programming Language Forum
Returning a new lifetime vs returning 'static lifetime
Hi everyone, this might be a basic question about lifetimes but I wanted to make sure if I understand it properly. I have two questions about the code snippet at the bottom: (part 1): are the function signatures foo and bar below equivalent? If there is no relation between 'a and 'b, does it always mean 'b can be replaced by 'static? I cannot think of a reason why not. bar's function signature is more readable than foo's. If they are equivalent, I expected clippy to suggest writing in bar form...
0 comments
No comments yet.