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`.
--- 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<Option<RevlogEntry>, RevlogError> {
+ pub fn p1_entry(
+ &self,
+ ) -> Result<Option<RevlogEntry<'revlog>>, RevlogError> {
if self.p1 == NULL_REVISION {
Ok(None)
} else {
@@ -438,7 +440,9 @@
}
}
- pub fn p2_entry(&self) -> Result<Option<RevlogEntry>, RevlogError> {
+ pub fn p2_entry(
+ &self,
+ ) -> Result<Option<RevlogEntry<'revlog>>, RevlogError> {
if self.p2 == NULL_REVISION {
Ok(None)
} else {