From ed559c11526377bb4a51aa2e8adf29749d4bb09a Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 16 Jan 2023 20:51:49 -0700 Subject: [PATCH] ssh-key: fix error type for `Signature` bytes conversion Addresses a TODO about changing the error type for `TryFrom<&[u8]>` to `ssh_key::Error`, now that the `signature` crate's bounds have been changed in order to make that possible. --- ssh-key/src/signature.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ssh-key/src/signature.rs b/ssh-key/src/signature.rs index c70a697e..f89748db 100644 --- a/ssh-key/src/signature.rs +++ b/ssh-key/src/signature.rs @@ -222,11 +222,10 @@ impl SignatureEncoding for Signature { /// Decode [`Signature`] from an [`Algorithm`]-prefixed OpenSSH-encoded bytestring. impl TryFrom<&[u8]> for Signature { - // TODO(tarcieri): use `ssh_key::Error` instead of `signature::Error` - type Error = signature::Error; + type Error = Error; - fn try_from(mut bytes: &[u8]) -> signature::Result { - Ok(Self::decode(&mut bytes)?) + fn try_from(mut bytes: &[u8]) -> Result { + Self::decode(&mut bytes) } }