diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/flate2/src/crc.rs | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/flate2/src/crc.rs')
-rw-r--r-- | vendor/flate2/src/crc.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/vendor/flate2/src/crc.rs b/vendor/flate2/src/crc.rs index cd00cebe1..16f560196 100644 --- a/vendor/flate2/src/crc.rs +++ b/vendor/flate2/src/crc.rs @@ -63,13 +63,13 @@ impl Crc { /// Combine the CRC with the CRC for the subsequent block of bytes. pub fn combine(&mut self, additional_crc: &Crc) { - self.amt += additional_crc.amt; + self.amt = self.amt.wrapping_add(additional_crc.amt); self.hasher.combine(&additional_crc.hasher); } } impl<R: Read> CrcReader<R> { - /// Create a new CrcReader. + /// Create a new `CrcReader`. pub fn new(r: R) -> CrcReader<R> { CrcReader { inner: r, @@ -79,27 +79,27 @@ impl<R: Read> CrcReader<R> { } impl<R> CrcReader<R> { - /// Get the Crc for this CrcReader. + /// Get the Crc for this `CrcReader`. pub fn crc(&self) -> &Crc { &self.crc } - /// Get the reader that is wrapped by this CrcReader. + /// Get the reader that is wrapped by this `CrcReader`. pub fn into_inner(self) -> R { self.inner } - /// Get the reader that is wrapped by this CrcReader by reference. + /// Get the reader that is wrapped by this `CrcReader` by reference. pub fn get_ref(&self) -> &R { &self.inner } - /// Get a mutable reference to the reader that is wrapped by this CrcReader. + /// Get a mutable reference to the reader that is wrapped by this `CrcReader`. pub fn get_mut(&mut self) -> &mut R { &mut self.inner } - /// Reset the Crc in this CrcReader. + /// Reset the Crc in this `CrcReader`. pub fn reset(&mut self) { self.crc.reset(); } @@ -135,34 +135,34 @@ pub struct CrcWriter<W> { } impl<W> CrcWriter<W> { - /// Get the Crc for this CrcWriter. + /// Get the Crc for this `CrcWriter`. pub fn crc(&self) -> &Crc { &self.crc } - /// Get the writer that is wrapped by this CrcWriter. + /// Get the writer that is wrapped by this `CrcWriter`. pub fn into_inner(self) -> W { self.inner } - /// Get the writer that is wrapped by this CrcWriter by reference. + /// Get the writer that is wrapped by this `CrcWriter` by reference. pub fn get_ref(&self) -> &W { &self.inner } - /// Get a mutable reference to the writer that is wrapped by this CrcWriter. + /// Get a mutable reference to the writer that is wrapped by this `CrcWriter`. pub fn get_mut(&mut self) -> &mut W { &mut self.inner } - /// Reset the Crc in this CrcWriter. + /// Reset the Crc in this `CrcWriter`. pub fn reset(&mut self) { self.crc.reset(); } } impl<W: Write> CrcWriter<W> { - /// Create a new CrcWriter. + /// Create a new `CrcWriter`. pub fn new(w: W) -> CrcWriter<W> { CrcWriter { inner: w, |