Mercurial > public > mercurial-scm > hg
comparison rust/hg-core/src/revlog/patch.rs @ 45599:cee7a8e37e9c
hg-core: minor rewording in docstring (D8958#inline-15005 followup)
Differential Revision: https://phab.mercurial-scm.org/D9104
author | Antoine cezar<acezar@chwitlabs.fr> |
---|---|
date | Mon, 28 Sep 2020 14:31:58 +0200 |
parents | 412a5827ad02 |
children | b68b19104d16 |
comparison
equal
deleted
inserted
replaced
45598:412a5827ad02 | 45599:cee7a8e37e9c |
---|---|
18 } | 18 } |
19 | 19 |
20 impl Chunk<'_> { | 20 impl Chunk<'_> { |
21 /// Adjusted start of the chunk to replace. | 21 /// Adjusted start of the chunk to replace. |
22 /// | 22 /// |
23 /// Offset allow to take into account the growth/shrinkage of data | 23 /// The offset, taking into account the growth/shrinkage of data |
24 /// induced by previously applied chunks. | 24 /// induced by previously applied chunks. |
25 fn start_offseted_by(&self, offset: i32) -> u32 { | 25 fn start_offseted_by(&self, offset: i32) -> u32 { |
26 let start = self.start as i32 + offset; | 26 let start = self.start as i32 + offset; |
27 assert!(start >= 0, "negative chunk start should never happen"); | 27 assert!(start >= 0, "negative chunk start should never happen"); |
28 start as u32 | 28 start as u32 |
29 } | 29 } |
30 | 30 |
31 /// Adjusted end of the chunk to replace. | 31 /// Adjusted end of the chunk to replace. |
32 /// | 32 /// |
33 /// Offset allow to take into account the growth/shrinkage of data | 33 /// The offset, taking into account the growth/shrinkage of data |
34 /// induced by previously applied chunks. | 34 /// induced by previously applied chunks. |
35 fn end_offseted_by(&self, offset: i32) -> u32 { | 35 fn end_offseted_by(&self, offset: i32) -> u32 { |
36 self.start_offseted_by(offset) + self.data.len() as u32 | 36 self.start_offseted_by(offset) + self.data.len() as u32 |
37 } | 37 } |
38 | 38 |