From 7accbdb3c6e6e084e071dc863341e6a3b865cbfc Mon Sep 17 00:00:00 2001 From: Gaspard WITRAND Date: Mon, 25 Nov 2024 17:28:38 +0100 Subject: [PATCH] Switching key to u8 and update on Pax header doc header --- src/pax.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pax.rs b/src/pax.rs index d1494282..6c60f634 100644 --- a/src/pax.rs +++ b/src/pax.rs @@ -147,7 +147,7 @@ impl<'entry> PaxExtension<'entry> { } } -/// Extension trait for `Builder` to append PAX extended headers. +/// Implement `Builder` to append PAX extended headers. impl crate::Builder { /// Append PAX extended headers to the archive. /// @@ -156,7 +156,7 @@ impl crate::Builder { /// Returns io::Error if an error occurs, else it returns () pub fn append_pax_extensions<'key, 'value>( &mut self, - headers: impl IntoIterator, + headers: impl IntoIterator, ) -> Result<(), io::Error> { // Store the headers formatted before write let mut data: Vec = Vec::new(); @@ -172,7 +172,9 @@ impl crate::Builder { max_len *= 10; } let len = rest_len + len_len; - write!(&mut data, "{} {}=", len, key)?; + write!(&mut data, "{} ", len)?; + data.extend_from_slice(key); + data.push(b'='); data.extend_from_slice(value); data.push(b'\n'); }