Mercurial > public > mercurial-scm > hg
diff rust/hg-core/src/revlog/index.rs @ 52290:a3fa37bdb7ec
rust: normalize `_for_unchecked_rev` naming among revlogs and the index
This normalizes the naming scheme between the `Revlog`, `Changelog`, etc.
which is less suprising, though no real bugs could stem from this because of
the type signature mismatch.
The very high-level `Repo` object still uses an `UncheckedRevision` parameter
for its methods because that's what most callers will want.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Tue, 29 Oct 2024 11:00:04 +0100 |
parents | bd8081e9fd62 |
children | a876ab6c3fd5 |
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/index.rs Tue Nov 12 12:45:23 2024 +0100 +++ b/rust/hg-core/src/revlog/index.rs Tue Oct 29 11:00:04 2024 +0100 @@ -507,8 +507,7 @@ /// Return the binary content of the index entry for the given revision /// - /// See [get_entry()](`Self::get_entry()`) for cases when `None` is - /// returned. + /// See [`Self::get_entry`] for cases when `None` is returned. pub fn entry_binary(&self, rev: Revision) -> Option<&[u8]> { self.get_entry(rev).map(|e| { let bytes = e.as_bytes(); @@ -536,11 +535,13 @@ .compressed_len() .try_into() .unwrap_or_else(|_| { - // Python's `unionrepo` sets the compressed length to be - // `-1` (or `u32::MAX` if transmuted to `u32`) because it + // Python's `unionrepo` sets the compressed length to + // be `-1` (or `u32::MAX` if + // transmuted to `u32`) because it // cannot know the correct compressed length of a given - // revision. I'm not sure if this is true, but having this - // edge case won't hurt other use cases, let's handle it. + // revision. I'm not sure if this is true, but having + // this edge case won't hurt + // other use cases, let's handle it. assert_eq!(e.compressed_len(), u32::MAX); NULL_REVISION.0 }),