@@ -5,6 +5,7 @@ use crate::{ByteRepr, Ptr, Value};
55use std:: cell:: RefCell ;
66use std:: rc:: Rc ;
77
8+ #[ derive( Default ) ]
89pub struct Tm {
910 pub tm_sec : Value < i32 > ,
1011 pub tm_min : Value < i32 > ,
@@ -19,24 +20,6 @@ pub struct Tm {
1920 pub tm_zone : Value < Ptr < u8 > > ,
2021}
2122
22- impl Default for Tm {
23- fn default ( ) -> Self {
24- Self {
25- tm_sec : Rc :: new ( RefCell :: new ( 0 ) ) ,
26- tm_min : Rc :: new ( RefCell :: new ( 0 ) ) ,
27- tm_hour : Rc :: new ( RefCell :: new ( 0 ) ) ,
28- tm_mday : Rc :: new ( RefCell :: new ( 0 ) ) ,
29- tm_mon : Rc :: new ( RefCell :: new ( 0 ) ) ,
30- tm_year : Rc :: new ( RefCell :: new ( 0 ) ) ,
31- tm_wday : Rc :: new ( RefCell :: new ( 0 ) ) ,
32- tm_yday : Rc :: new ( RefCell :: new ( 0 ) ) ,
33- tm_isdst : Rc :: new ( RefCell :: new ( 0 ) ) ,
34- tm_gmtoff : Rc :: new ( RefCell :: new ( 0 ) ) ,
35- tm_zone : Rc :: new ( RefCell :: new ( Ptr :: null ( ) ) ) ,
36- }
37- }
38- }
39-
4023impl Clone for Tm {
4124 fn clone ( & self ) -> Self {
4225 Self {
@@ -57,20 +40,12 @@ impl Clone for Tm {
5740
5841impl ByteRepr for Tm { }
5942
43+ #[ derive( Default ) ]
6044pub struct Timeval {
6145 pub tv_sec : Value < i64 > ,
6246 pub tv_usec : Value < i64 > ,
6347}
6448
65- impl Default for Timeval {
66- fn default ( ) -> Self {
67- Self {
68- tv_sec : Rc :: new ( RefCell :: new ( 0 ) ) ,
69- tv_usec : Rc :: new ( RefCell :: new ( 0 ) ) ,
70- }
71- }
72- }
73-
7449impl Clone for Timeval {
7550 fn clone ( & self ) -> Self {
7651 Self {
@@ -82,20 +57,12 @@ impl Clone for Timeval {
8257
8358impl ByteRepr for Timeval { }
8459
60+ #[ derive( Default ) ]
8561pub struct Timespec {
8662 pub tv_sec : Value < i64 > ,
8763 pub tv_nsec : Value < i64 > ,
8864}
8965
90- impl Default for Timespec {
91- fn default ( ) -> Self {
92- Self {
93- tv_sec : Rc :: new ( RefCell :: new ( 0 ) ) ,
94- tv_nsec : Rc :: new ( RefCell :: new ( 0 ) ) ,
95- }
96- }
97- }
98-
9966impl Clone for Timespec {
10067 fn clone ( & self ) -> Self {
10168 Self {
0 commit comments