This is a follow up to this question
I have another enum:
enum InfoP<'a, 'b> {
Imut(&'a Info<'b>),
Mut(&'a mut Info<'b>),
}
So I tried the solution:
impl<'a, 'b> InfoP<'a, 'b> {
fn reborrow(self: &mut InfoP<'a, 'b>) -> InfoP<'a, 'b> {
match *self {
InfoP::Imut(info) => InfoP::Imut(info),
InfoP::Mut(ref mut info) => InfoP::Mut(*info),
}
}
}
Hoever this doesn't work
lifetime may not live long enough
associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
How can I fix this?