First version modifies vector which means it has unique mutable reference to it. Unique references are, well⦠unique. And thus you can not return shared reference to the element because it would clash with unique mutable reference to the whole vector.
Second version doesn't change anything, it's only receives shared read-only reference⦠and these can be easily copied around.
You can get a &'long _ out from a &'short self.0 by copying, and thus always return an Option<&'a i32> in the case of JustLast. But you can only get a &'short mut _ out from &'short mut self in the case of PushThenLast.
This signature would work:
fn call_mut(&mut self) -> Option<&i32> {
but the FnMut trait doesn't allow that; it only allows return values independent of the &mut self borrow.