From patchwork Fri Oct 1 15:46:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11548: hg-core: silence dead-code warning by adding RevlogEntry::revion() accessor From: phabricator X-Patchwork-Id: 49872 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 1 Oct 2021 15:46:04 +0000 martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11548 AFFECTED FILES rust/hg-core/src/revlog/revlog.rs CHANGE DETAILS To: martinvonz, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/rust/hg-core/src/revlog/revlog.rs b/rust/hg-core/src/revlog/revlog.rs --- a/rust/hg-core/src/revlog/revlog.rs +++ b/rust/hg-core/src/revlog/revlog.rs @@ -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, RevlogError> { if self.bytes.is_empty() {