File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 88//! serialized signatures and since it's a bit more complicated it has its own module.
99
1010use core:: borrow:: Borrow ;
11+ use core:: convert:: TryFrom ;
1112use core:: { fmt, ops} ;
1213
1314pub use into_iter:: IntoIter ;
@@ -91,6 +92,28 @@ impl<'a> IntoIterator for &'a SerializedSignature {
9192 fn into_iter ( self ) -> Self :: IntoIter { self . iter ( ) }
9293}
9394
95+ impl From < Signature > for SerializedSignature {
96+ fn from ( value : Signature ) -> Self { Self :: from_signature ( & value) }
97+ }
98+
99+ impl < ' a > From < & ' a Signature > for SerializedSignature {
100+ fn from ( value : & ' a Signature ) -> Self { Self :: from_signature ( value) }
101+ }
102+
103+ impl TryFrom < SerializedSignature > for Signature {
104+ type Error = Error ;
105+
106+ fn try_from ( value : SerializedSignature ) -> Result < Self , Self :: Error > { value. to_signature ( ) }
107+ }
108+
109+ impl < ' a > TryFrom < & ' a SerializedSignature > for Signature {
110+ type Error = Error ;
111+
112+ fn try_from ( value : & ' a SerializedSignature ) -> Result < Self , Self :: Error > {
113+ value. to_signature ( )
114+ }
115+ }
116+
94117impl SerializedSignature {
95118 /// Creates `SerializedSignature` from data and length.
96119 ///
You can’t perform that action at this time.
0 commit comments