From 65eb2dff635bc17e29868f8f481329fabc9d935e Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 10 Mar 2020 12:03:49 -0700 Subject: [PATCH] signature: have Signature::from_bytes take a byte slice ...rather than `impl AsRef<[u8]>`, which both breaks object safety, and in many cases is less convenient (e.g. when deref coercion would allow types that don't impl AsRef to work) --- signature/src/signature.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/signature/src/signature.rs b/signature/src/signature.rs index 75a5dfd70..d47978e00 100644 --- a/signature/src/signature.rs +++ b/signature/src/signature.rs @@ -14,7 +14,7 @@ use crate::{ /// Trait impl'd by concrete types that represent digital signatures pub trait Signature: AsRef<[u8]> + Debug + Sized { /// Parse a signature from its byte representation - fn from_bytes(bytes: impl AsRef<[u8]>) -> Result; + fn from_bytes(bytes: &[u8]) -> Result; /// Borrow this signature as serialized bytes fn as_slice(&self) -> &[u8] {