Mercurial > hg-stable
changeset 48095:fecfea658127
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 01 Oct 2021 08:44:56 -0700 |
parents | 789475ef2b22 |
children | 596510cd2b12 |
files | rust/hg-core/src/revlog/revlog.rs |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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() {