rust/hg-core/src/revlog/revlog.rs
changeset 48540 20d0d896183e
parent 48458 96ea4db4741b
child 48541 f2f57724d4eb
--- a/rust/hg-core/src/revlog/revlog.rs	Wed Jan 05 13:36:05 2022 -0500
+++ b/rust/hg-core/src/revlog/revlog.rs	Tue Dec 21 15:57:30 2021 +0100
@@ -214,7 +214,7 @@
             .ok_or(RevlogError::InvalidRevision)?;
 
         let data: Vec<u8> = if delta_chain.is_empty() {
-            entry.data()?.into()
+            entry.data_chunk()?.into()
         } else {
             Revlog::build_data_from_deltas(entry, &delta_chain)?
         };
@@ -260,11 +260,11 @@
         snapshot: RevlogEntry,
         deltas: &[RevlogEntry],
     ) -> Result<Vec<u8>, RevlogError> {
-        let snapshot = snapshot.data()?;
+        let snapshot = snapshot.data_chunk()?;
         let deltas = deltas
             .iter()
             .rev()
-            .map(RevlogEntry::data)
+            .map(RevlogEntry::data_chunk)
             .collect::<Result<Vec<Cow<'_, [u8]>>, RevlogError>>()?;
         let patches: Vec<_> =
             deltas.iter().map(|d| patch::PatchList::new(d)).collect();
@@ -339,7 +339,8 @@
     }
 
     /// Extract the data contained in the entry.
-    pub fn data(&self) -> Result<Cow<'_, [u8]>, RevlogError> {
+    /// This may be a delta. (See `is_delta`.)
+    fn data_chunk(&self) -> Result<Cow<'_, [u8]>, RevlogError> {
         if self.bytes.is_empty() {
             return Ok(Cow::Borrowed(&[]));
         }