summaryrefslogtreecommitdiffstats
path: root/vendor/gix-pack/src/data/entry
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix-pack/src/data/entry
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-pack/src/data/entry')
-rw-r--r--vendor/gix-pack/src/data/entry/decode.rs8
-rw-r--r--vendor/gix-pack/src/data/entry/header.rs4
2 files changed, 6 insertions, 6 deletions
diff --git a/vendor/gix-pack/src/data/entry/decode.rs b/vendor/gix-pack/src/data/entry/decode.rs
index 79d7aecff..b81320319 100644
--- a/vendor/gix-pack/src/data/entry/decode.rs
+++ b/vendor/gix-pack/src/data/entry/decode.rs
@@ -47,16 +47,16 @@ impl data::Entry {
/// Instantiate an `Entry` from the reader `r`, providing the `pack_offset` to allow tracking the start of the entry data section.
pub fn from_read(
- mut r: impl io::Read,
+ r: &mut dyn io::Read,
pack_offset: data::Offset,
hash_len: usize,
) -> Result<data::Entry, io::Error> {
- let (type_id, size, mut consumed) = streaming_parse_header_info(&mut r)?;
+ let (type_id, size, mut consumed) = streaming_parse_header_info(r)?;
use crate::data::entry::Header::*;
let object = match type_id {
OFS_DELTA => {
- let (distance, leb_bytes) = leb64_from_read(&mut r)?;
+ let (distance, leb_bytes) = leb64_from_read(r)?;
let delta = OfsDelta {
base_distance: distance,
};
@@ -89,7 +89,7 @@ impl data::Entry {
}
#[inline]
-fn streaming_parse_header_info(mut read: impl io::Read) -> Result<(u8, u64, usize), io::Error> {
+fn streaming_parse_header_info(read: &mut dyn io::Read) -> Result<(u8, u64, usize), io::Error> {
let mut byte = [0u8; 1];
read.read_exact(&mut byte)?;
let mut c = byte[0];
diff --git a/vendor/gix-pack/src/data/entry/header.rs b/vendor/gix-pack/src/data/entry/header.rs
index 4d0dbf4d2..358bd743c 100644
--- a/vendor/gix-pack/src/data/entry/header.rs
+++ b/vendor/gix-pack/src/data/entry/header.rs
@@ -83,7 +83,7 @@ impl Header {
///
/// Returns the amount of bytes written to `out`.
/// `decompressed_size_in_bytes` is the full size in bytes of the object that this header represents
- pub fn write_to(&self, decompressed_size_in_bytes: u64, mut out: impl io::Write) -> io::Result<usize> {
+ pub fn write_to(&self, decompressed_size_in_bytes: u64, out: &mut dyn io::Write) -> io::Result<usize> {
let mut size = decompressed_size_in_bytes;
let mut written = 1;
let mut c: u8 = (self.as_type_id() << 4) | (size as u8 & 0b0000_1111);
@@ -115,7 +115,7 @@ impl Header {
/// The size of the header in bytes when serialized
pub fn size(&self, decompressed_size: u64) -> usize {
- self.write_to(decompressed_size, io::sink())
+ self.write_to(decompressed_size, &mut io::sink())
.expect("io::sink() to never fail")
}
}