From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-actor/src/identity.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'vendor/gix-actor/src/identity.rs') diff --git a/vendor/gix-actor/src/identity.rs b/vendor/gix-actor/src/identity.rs index 0e7c0e6d5..e6d8fcb52 100644 --- a/vendor/gix-actor/src/identity.rs +++ b/vendor/gix-actor/src/identity.rs @@ -1,14 +1,15 @@ use bstr::ByteSlice; +use winnow::{error::StrContext, prelude::*}; use crate::{signature::decode, Identity, IdentityRef}; impl<'a> IdentityRef<'a> { /// Deserialize an identity from the given `data`. - pub fn from_bytes(data: &'a [u8]) -> Result> + pub fn from_bytes(mut data: &'a [u8]) -> Result> where - E: nom::error::ParseError<&'a [u8]> + nom::error::ContextError<&'a [u8]>, + E: winnow::error::ParserError<&'a [u8]> + winnow::error::AddContext<&'a [u8], StrContext>, { - decode::identity(data).map(|(_, t)| t) + decode::identity.parse_next(&mut data) } /// Create an owned instance from this shared one. @@ -34,14 +35,14 @@ mod write { /// Output impl Identity { /// Serialize this instance to `out` in the git serialization format for signatures (but without timestamp). - pub fn write_to(&self, out: impl std::io::Write) -> std::io::Result<()> { + pub fn write_to(&self, out: &mut dyn std::io::Write) -> std::io::Result<()> { self.to_ref().write_to(out) } } impl<'a> IdentityRef<'a> { /// Serialize this instance to `out` in the git serialization format for signatures (but without timestamp). - pub fn write_to(&self, mut out: impl std::io::Write) -> std::io::Result<()> { + pub fn write_to(&self, out: &mut dyn std::io::Write) -> std::io::Result<()> { out.write_all(validated_token(self.name)?)?; out.write_all(b" ")?; out.write_all(b"<")?; -- cgit v1.2.3