diff rust/hg-core/src/revlog/changelog.rs @ 47969:87e3f878e65f

rust: Rename get_node methods to data_for_node, get_rev to data_for_rev These are respective methods of Changelog, Manifestlog, and Filelog; three Rust structs that that wrap a Revlog struct. This rename clarifies that node IDs or revision numbers are parameters, not return values. Also reword doc-comments in Manifestlog and Filelog to separate node IDs and revision numbers that are local to a given (non-changelog) revlog from those of a changeset. Differential Revision: https://phab.mercurial-scm.org/D11416
author Simon Sapin <simon.sapin@octobus.net>
date Tue, 14 Sep 2021 18:25:51 +0200
parents 6f579618ea7b
children 61ce70fd420e
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/changelog.rs	Tue Sep 14 18:10:35 2021 +0200
+++ b/rust/hg-core/src/revlog/changelog.rs	Tue Sep 14 18:25:51 2021 +0200
@@ -17,17 +17,17 @@
         Ok(Self { revlog })
     }
 
-    /// Return the `ChangelogEntry` a given node id.
-    pub fn get_node(
+    /// Return the `ChangelogEntry` for the given node ID.
+    pub fn data_for_node(
         &self,
         node: NodePrefix,
     ) -> Result<ChangelogEntry, RevlogError> {
         let rev = self.revlog.rev_from_node(node)?;
-        self.get_rev(rev)
+        self.data_for_rev(rev)
     }
 
-    /// Return the `ChangelogEntry` of a given node revision.
-    pub fn get_rev(
+    /// Return the `ChangelogEntry` of the given revision number.
+    pub fn data_for_rev(
         &self,
         rev: Revision,
     ) -> Result<ChangelogEntry, RevlogError> {