##// END OF EJS Templates
rust-revlog: explicit naming for `RevlogEntry` lifetime...
Georges Racinet -
r51269:7ef51fff default
parent child Browse files
Show More
@@ -400,10 +400,10 b' impl Revlog {'
400 /// The revlog entry's bytes and the necessary informations to extract
400 /// The revlog entry's bytes and the necessary informations to extract
401 /// the entry's data.
401 /// the entry's data.
402 #[derive(Clone)]
402 #[derive(Clone)]
403 pub struct RevlogEntry<'a> {
403 pub struct RevlogEntry<'revlog> {
404 revlog: &'a Revlog,
404 revlog: &'revlog Revlog,
405 rev: Revision,
405 rev: Revision,
406 bytes: &'a [u8],
406 bytes: &'revlog [u8],
407 compressed_len: u32,
407 compressed_len: u32,
408 uncompressed_len: i32,
408 uncompressed_len: i32,
409 base_rev_or_base_of_delta_chain: Option<Revision>,
409 base_rev_or_base_of_delta_chain: Option<Revision>,
@@ -413,7 +413,7 b" pub struct RevlogEntry<'a> {"
413 hash: Node,
413 hash: Node,
414 }
414 }
415
415
416 impl<'a> RevlogEntry<'a> {
416 impl<'revlog> RevlogEntry<'revlog> {
417 pub fn revision(&self) -> Revision {
417 pub fn revision(&self) -> Revision {
418 self.rev
418 self.rev
419 }
419 }
@@ -473,7 +473,7 b" impl<'a> RevlogEntry<'a> {"
473 }
473 }
474
474
475 /// The data for this entry, after resolving deltas if any.
475 /// The data for this entry, after resolving deltas if any.
476 pub fn rawdata(&self) -> Result<Cow<'a, [u8]>, HgError> {
476 pub fn rawdata(&self) -> Result<Cow<'revlog, [u8]>, HgError> {
477 let mut entry = self.clone();
477 let mut entry = self.clone();
478 let mut delta_chain = vec![];
478 let mut delta_chain = vec![];
479
479
@@ -503,8 +503,8 b" impl<'a> RevlogEntry<'a> {"
503
503
504 fn check_data(
504 fn check_data(
505 &self,
505 &self,
506 data: Cow<'a, [u8]>,
506 data: Cow<'revlog, [u8]>,
507 ) -> Result<Cow<'a, [u8]>, HgError> {
507 ) -> Result<Cow<'revlog, [u8]>, HgError> {
508 if self.revlog.check_hash(
508 if self.revlog.check_hash(
509 self.p1,
509 self.p1,
510 self.p2,
510 self.p2,
@@ -525,7 +525,7 b" impl<'a> RevlogEntry<'a> {"
525 }
525 }
526 }
526 }
527
527
528 pub fn data(&self) -> Result<Cow<'a, [u8]>, HgError> {
528 pub fn data(&self) -> Result<Cow<'revlog, [u8]>, HgError> {
529 let data = self.rawdata()?;
529 let data = self.rawdata()?;
530 if self.is_censored() {
530 if self.is_censored() {
531 return Err(HgError::CensoredNodeError);
531 return Err(HgError::CensoredNodeError);
@@ -535,7 +535,7 b" impl<'a> RevlogEntry<'a> {"
535
535
536 /// Extract the data contained in the entry.
536 /// Extract the data contained in the entry.
537 /// This may be a delta. (See `is_delta`.)
537 /// This may be a delta. (See `is_delta`.)
538 fn data_chunk(&self) -> Result<Cow<'a, [u8]>, HgError> {
538 fn data_chunk(&self) -> Result<Cow<'revlog, [u8]>, HgError> {
539 if self.bytes.is_empty() {
539 if self.bytes.is_empty() {
540 return Ok(Cow::Borrowed(&[]));
540 return Ok(Cow::Borrowed(&[]));
541 }
541 }
General Comments 0
You need to be logged in to leave comments. Login now