There comes a point in every rustacean's life when it learns about for>) {}
fn bar(_b: Box>) {}
What is the difference between them?
In short, the difference between foo and bar is that in foo() the lifetime for the internal usize reference is provided by the caller of the function, while in bar() the same lifetime is provided by the function itself. And this distinction is very important for the implementation of foo/bar.
Also, you can read alternate explanations here:
🔘 For
fn bar(_b: Box>) {}
What is the difference between them?
In short, the difference between foo and bar is that in foo() the lifetime for the internal usize reference is provided by the caller of the function, while in bar() the same lifetime is provided by the function itself. And this distinction is very important for the implementation of foo/bar.
Also, you can read alternate explanations here:
🔘 For