# HG changeset patch # User Georges Racinet # Date 1680171653 -7200 # Node ID c101e7757ed77f989457f5869bd5ead8d566a736 # Parent 7ef51fff2c4f6f7f21bee618ebdcb257d8d4984a rust-revlog: fix lifetime problem for RevlogEntry parent entries accessors Without this, the lifetime of the result is equated to the lifetime of the `self` reference, preventing callers, e.g., to take a `RevlogEntry` and return its `p1_entry()`, as it looks like returning something that does not outlive the *reference to* the `RevlogEntry`. diff -r 7ef51fff2c4f -r c101e7757ed7 rust/hg-core/src/revlog/mod.rs --- a/rust/hg-core/src/revlog/mod.rs Thu Mar 30 12:14:57 2023 +0200 +++ b/rust/hg-core/src/revlog/mod.rs Thu Mar 30 12:20:53 2023 +0200 @@ -430,7 +430,9 @@ self.p1 != NULL_REVISION } - pub fn p1_entry(&self) -> Result, RevlogError> { + pub fn p1_entry( + &self, + ) -> Result>, RevlogError> { if self.p1 == NULL_REVISION { Ok(None) } else { @@ -438,7 +440,9 @@ } } - pub fn p2_entry(&self) -> Result, RevlogError> { + pub fn p2_entry( + &self, + ) -> Result>, RevlogError> { if self.p2 == NULL_REVISION { Ok(None) } else {