Mercurial > hg
comparison rust/hg-core/src/revlog/index.rs @ 51257:e74dd6d73cb5
rust-index: allow inlining `parents` across crates
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Thu, 23 Nov 2023 18:48:07 +0100 |
parents | eb676c35a29b |
children | ed6683d4cb29 |
comparison
equal
deleted
inserted
replaced
51256:83de5a06f6eb | 51257:e74dd6d73cb5 |
---|---|
278 .finish() | 278 .finish() |
279 } | 279 } |
280 } | 280 } |
281 | 281 |
282 impl Graph for Index { | 282 impl Graph for Index { |
283 #[inline(always)] | |
283 fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> { | 284 fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> { |
284 let err = || GraphError::ParentOutOfRange(rev); | 285 let err = || GraphError::ParentOutOfRange(rev); |
285 match self.get_entry(rev) { | 286 match self.get_entry(rev) { |
286 Some(entry) => { | 287 Some(entry) => { |
287 // The C implementation checks that the parents are valid | 288 // The C implementation checks that the parents are valid |