hg-core: silence dead-code warning by adding RevlogEntry::revion() accessor
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 01 Oct 2021 08:44:56 -0700
changeset 48083 fecfea658127
parent 48082 789475ef2b22
child 48084 596510cd2b12
hg-core: silence dead-code warning by adding RevlogEntry::revion() accessor Nightly `rustc` warns about the `RevlogEntry::rev` field not being used. Rather than removing it, I added an accessor since it seems useful to be able to get the entry's revision. Differential Revision: https://phab.mercurial-scm.org/D11548
rust/hg-core/src/revlog/revlog.rs
--- a/rust/hg-core/src/revlog/revlog.rs	Fri Oct 01 18:14:56 2021 +0200
+++ b/rust/hg-core/src/revlog/revlog.rs	Fri Oct 01 08:44:56 2021 -0700
@@ -304,6 +304,10 @@
 }
 
 impl<'a> RevlogEntry<'a> {
+    pub fn revision(&self) -> Revision {
+        self.rev
+    }
+
     /// Extract the data contained in the entry.
     pub fn data(&self) -> Result<Cow<'_, [u8]>, RevlogError> {
         if self.bytes.is_empty() {