@@ -27,7 +27,6 @@ const _PyDateTime_TIME_DATASIZE: usize = 6;
27
27
const _PyDateTime_DATETIME_DATASIZE: usize = 10 ;
28
28
29
29
#[ repr( C ) ]
30
- #[ derive( Debug , Copy , Clone ) ]
31
30
/// Structure representing a `datetime.timedelta`.
32
31
pub struct PyDateTime_Delta {
33
32
pub ob_base : PyObject ,
@@ -46,7 +45,6 @@ pub struct PyDateTime_Delta {
46
45
47
46
#[ cfg( not( any( PyPy , GraalPy ) ) ) ]
48
47
#[ repr( C ) ]
49
- #[ derive( Debug , Copy , Clone ) ]
50
48
/// Structure representing a `datetime.time` without a `tzinfo` member.
51
49
pub struct _PyDateTime_BaseTime {
52
50
pub ob_base : PyObject ,
@@ -56,7 +54,6 @@ pub struct _PyDateTime_BaseTime {
56
54
}
57
55
58
56
#[ repr( C ) ]
59
- #[ derive( Debug , Copy , Clone ) ]
60
57
/// Structure representing a `datetime.time`.
61
58
pub struct PyDateTime_Time {
62
59
pub ob_base : PyObject ,
@@ -77,7 +74,6 @@ pub struct PyDateTime_Time {
77
74
}
78
75
79
76
#[ repr( C ) ]
80
- #[ derive( Debug , Copy , Clone ) ]
81
77
/// Structure representing a `datetime.date`
82
78
pub struct PyDateTime_Date {
83
79
pub ob_base : PyObject ,
@@ -91,7 +87,6 @@ pub struct PyDateTime_Date {
91
87
92
88
#[ cfg( not( any( PyPy , GraalPy ) ) ) ]
93
89
#[ repr( C ) ]
94
- #[ derive( Debug , Copy , Clone ) ]
95
90
/// Structure representing a `datetime.datetime` without a `tzinfo` member.
96
91
pub struct _PyDateTime_BaseDateTime {
97
92
pub ob_base : PyObject ,
@@ -101,7 +96,6 @@ pub struct _PyDateTime_BaseDateTime {
101
96
}
102
97
103
98
#[ repr( C ) ]
104
- #[ derive( Debug , Copy , Clone ) ]
105
99
/// Structure representing a `datetime.datetime`.
106
100
pub struct PyDateTime_DateTime {
107
101
pub ob_base : PyObject ,
@@ -130,26 +124,26 @@ pub struct PyDateTime_DateTime {
130
124
/// Returns a signed integer greater than 0.
131
125
pub unsafe fn PyDateTime_GET_YEAR ( o : * mut PyObject ) -> c_int {
132
126
// This should work for Date or DateTime
133
- let d = * ( o as * mut PyDateTime_Date ) ;
134
- c_int:: from ( d . data [ 0 ] ) << 8 | c_int:: from ( d . data [ 1 ] )
127
+ let data = ( * ( o as * mut PyDateTime_Date ) ) . data ;
128
+ c_int:: from ( data[ 0 ] ) << 8 | c_int:: from ( data[ 1 ] )
135
129
}
136
130
137
131
#[ inline]
138
132
#[ cfg( not( any( PyPy , GraalPy ) ) ) ]
139
133
/// Retrieve the month component of a `PyDateTime_Date` or `PyDateTime_DateTime`.
140
134
/// Returns a signed integer in the range `[1, 12]`.
141
135
pub unsafe fn PyDateTime_GET_MONTH ( o : * mut PyObject ) -> c_int {
142
- let d = * ( o as * mut PyDateTime_Date ) ;
143
- c_int:: from ( d . data [ 2 ] )
136
+ let data = ( * ( o as * mut PyDateTime_Date ) ) . data ;
137
+ c_int:: from ( data[ 2 ] )
144
138
}
145
139
146
140
#[ inline]
147
141
#[ cfg( not( any( PyPy , GraalPy ) ) ) ]
148
142
/// Retrieve the day component of a `PyDateTime_Date` or `PyDateTime_DateTime`.
149
143
/// Returns a signed integer in the interval `[1, 31]`.
150
144
pub unsafe fn PyDateTime_GET_DAY ( o : * mut PyObject ) -> c_int {
151
- let d = * ( o as * mut PyDateTime_Date ) ;
152
- c_int:: from ( d . data [ 3 ] )
145
+ let data = ( * ( o as * mut PyDateTime_Date ) ) . data ;
146
+ c_int:: from ( data[ 3 ] )
153
147
}
154
148
155
149
// Accessor macros for times
0 commit comments