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 8
8
//! serialized signatures and since it's a bit more complicated it has its own module.
9
9
10
10
use core:: borrow:: Borrow ;
11
+ use core:: convert:: TryFrom ;
11
12
use core:: { fmt, ops} ;
12
13
13
14
pub use into_iter:: IntoIter ;
@@ -91,6 +92,28 @@ impl<'a> IntoIterator for &'a SerializedSignature {
91
92
fn into_iter ( self ) -> Self :: IntoIter { self . iter ( ) }
92
93
}
93
94
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
+
94
117
impl SerializedSignature {
95
118
/// Creates `SerializedSignature` from data and length.
96
119
///
You can’t perform that action at this time.
0 commit comments