summaryrefslogtreecommitdiffstats
path: root/vendor/gix-object/src/encode.rs
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-object/src/encode.rs
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-object/src/encode.rs')
-rw-r--r--vendor/gix-object/src/encode.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/vendor/gix-object/src/encode.rs b/vendor/gix-object/src/encode.rs
index 6d291c92a..3ba7db0b5 100644
--- a/vendor/gix-object/src/encode.rs
+++ b/vendor/gix-object/src/encode.rs
@@ -34,9 +34,9 @@ impl From<Error> for io::Error {
}
}
-pub(crate) fn header_field_multi_line(name: &[u8], value: &[u8], mut out: impl io::Write) -> io::Result<()> {
+pub(crate) fn header_field_multi_line(name: &[u8], value: &[u8], out: &mut dyn io::Write) -> io::Result<()> {
let mut lines = value.as_bstr().split_str(b"\n");
- trusted_header_field(name, lines.next().ok_or(Error::EmptyValue)?, &mut out)?;
+ trusted_header_field(name, lines.next().ok_or(Error::EmptyValue)?, out)?;
for line in lines {
out.write_all(SPACE)?;
out.write_all(line)?;
@@ -45,7 +45,7 @@ pub(crate) fn header_field_multi_line(name: &[u8], value: &[u8], mut out: impl i
Ok(())
}
-pub(crate) fn trusted_header_field(name: &[u8], value: &[u8], mut out: impl io::Write) -> io::Result<()> {
+pub(crate) fn trusted_header_field(name: &[u8], value: &[u8], out: &mut dyn io::Write) -> io::Result<()> {
out.write_all(name)?;
out.write_all(SPACE)?;
out.write_all(value)?;
@@ -55,22 +55,26 @@ pub(crate) fn trusted_header_field(name: &[u8], value: &[u8], mut out: impl io::
pub(crate) fn trusted_header_signature(
name: &[u8],
value: &gix_actor::SignatureRef<'_>,
- mut out: impl io::Write,
+ out: &mut dyn io::Write,
) -> io::Result<()> {
out.write_all(name)?;
out.write_all(SPACE)?;
- value.write_to(&mut out)?;
+ value.write_to(out)?;
out.write_all(NL)
}
-pub(crate) fn trusted_header_id(name: &[u8], value: &gix_hash::ObjectId, mut out: impl io::Write) -> io::Result<()> {
+pub(crate) fn trusted_header_id(
+ name: &[u8],
+ value: &gix_hash::ObjectId,
+ mut out: &mut dyn io::Write,
+) -> io::Result<()> {
out.write_all(name)?;
out.write_all(SPACE)?;
value.write_hex_to(&mut out)?;
out.write_all(NL)
}
-pub(crate) fn header_field(name: &[u8], value: &[u8], out: impl io::Write) -> io::Result<()> {
+pub(crate) fn header_field(name: &[u8], value: &[u8], out: &mut dyn io::Write) -> io::Result<()> {
if value.is_empty() {
return Err(Error::EmptyValue.into());
}