@@ -42,19 +42,7 @@ impl Clone for MyContainer_int_ {
4242 this
4343 }
4444}
45- impl ByteRepr for MyContainer_int_ {
46- fn byte_size ( ) -> usize {
47- 24
48- }
49- fn to_bytes ( & self , buf : & mut [ u8 ] ) {
50- ( * self . vec_ . borrow ( ) ) . to_bytes ( & mut buf[ 0 ..24 ] ) ;
51- }
52- fn from_bytes ( buf : & [ u8 ] ) -> Self {
53- Self {
54- vec_ : Rc :: new ( RefCell :: new ( <Vec < i32 > >:: from_bytes ( & buf[ 0 ..24 ] ) ) ) ,
55- }
56- }
57- }
45+ impl ByteRepr for MyContainer_int_ { }
5846#[ derive( Default ) ]
5947pub struct MyContainer_char_ {
6048 vec_ : Value < Vec < u8 > > ,
@@ -91,19 +79,7 @@ impl Clone for MyContainer_char_ {
9179 this
9280 }
9381}
94- impl ByteRepr for MyContainer_char_ {
95- fn byte_size ( ) -> usize {
96- 24
97- }
98- fn to_bytes ( & self , buf : & mut [ u8 ] ) {
99- ( * self . vec_ . borrow ( ) ) . to_bytes ( & mut buf[ 0 ..24 ] ) ;
100- }
101- fn from_bytes ( buf : & [ u8 ] ) -> Self {
102- Self {
103- vec_ : Rc :: new ( RefCell :: new ( <Vec < u8 > >:: from_bytes ( & buf[ 0 ..24 ] ) ) ) ,
104- }
105- }
106- }
82+ impl ByteRepr for MyContainer_char_ { }
10783#[ derive( Default ) ]
10884pub struct MyContainer_float_ {
10985 vec_ : Value < Vec < f32 > > ,
@@ -140,19 +116,7 @@ impl Clone for MyContainer_float_ {
140116 this
141117 }
142118}
143- impl ByteRepr for MyContainer_float_ {
144- fn byte_size ( ) -> usize {
145- 24
146- }
147- fn to_bytes ( & self , buf : & mut [ u8 ] ) {
148- ( * self . vec_ . borrow ( ) ) . to_bytes ( & mut buf[ 0 ..24 ] ) ;
149- }
150- fn from_bytes ( buf : & [ u8 ] ) -> Self {
151- Self {
152- vec_ : Rc :: new ( RefCell :: new ( <Vec < f32 > >:: from_bytes ( & buf[ 0 ..24 ] ) ) ) ,
153- }
154- }
155- }
119+ impl ByteRepr for MyContainer_float_ { }
156120pub fn main ( ) {
157121 std:: process:: exit ( main_0 ( ) ) ;
158122}
0 commit comments