diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix-actor/src/identity.rs | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-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-actor/src/identity.rs')
-rw-r--r-- | vendor/gix-actor/src/identity.rs | 11 |
1 files changed, 6 insertions, 5 deletions
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<E>(data: &'a [u8]) -> Result<Self, nom::Err<E>> + pub fn from_bytes<E>(mut data: &'a [u8]) -> Result<Self, winnow::error::ErrMode<E>> 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"<")?; |