File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99use core:: fmt;
1010
11+ #[ cfg( feature = "arbitrary" ) ]
12+ use actual_arbitrary:: { self as arbitrary, Arbitrary , Unstructured } ;
1113use io:: { Read , Write } ;
1214
1315use super :: serialize:: { Deserialize , Serialize } ;
@@ -198,3 +200,21 @@ where
198200 Ok ( deserialize ( & key. key ) ?)
199201 }
200202}
203+
204+ #[ cfg( feature = "arbitrary" ) ]
205+ impl < ' a > Arbitrary < ' a > for ProprietaryKey {
206+ fn arbitrary ( u : & mut Unstructured < ' a > ) -> arbitrary:: Result < Self > {
207+ Ok ( ProprietaryKey {
208+ prefix : Vec :: < u8 > :: arbitrary ( u) ?,
209+ subtype : u8:: arbitrary ( u) ?,
210+ key : Vec :: < u8 > :: arbitrary ( u) ?,
211+ } )
212+ }
213+ }
214+
215+ #[ cfg( feature = "arbitrary" ) ]
216+ impl < ' a > Arbitrary < ' a > for Key {
217+ fn arbitrary ( u : & mut Unstructured < ' a > ) -> arbitrary:: Result < Self > {
218+ Ok ( Key { type_value : u. arbitrary ( ) ?, key : Vec :: < u8 > :: arbitrary ( u) ? } )
219+ }
220+ }
You can’t perform that action at this time.
0 commit comments