@@ -27,7 +27,6 @@ const _PyDateTime_TIME_DATASIZE: usize = 6;
2727const _PyDateTime_DATETIME_DATASIZE: usize = 10 ;
2828
2929#[ repr( C ) ]
30- #[ derive( Debug , Copy , Clone ) ]
3130/// Structure representing a `datetime.timedelta`.
3231pub struct PyDateTime_Delta {
3332 pub ob_base : PyObject ,
@@ -46,7 +45,6 @@ pub struct PyDateTime_Delta {
4645
4746#[ cfg( not( any( PyPy , GraalPy ) ) ) ]
4847#[ repr( C ) ]
49- #[ derive( Debug , Copy , Clone ) ]
5048/// Structure representing a `datetime.time` without a `tzinfo` member.
5149pub struct _PyDateTime_BaseTime {
5250 pub ob_base : PyObject ,
@@ -56,7 +54,6 @@ pub struct _PyDateTime_BaseTime {
5654}
5755
5856#[ repr( C ) ]
59- #[ derive( Debug , Copy , Clone ) ]
6057/// Structure representing a `datetime.time`.
6158pub struct PyDateTime_Time {
6259 pub ob_base : PyObject ,
@@ -77,7 +74,6 @@ pub struct PyDateTime_Time {
7774}
7875
7976#[ repr( C ) ]
80- #[ derive( Debug , Copy , Clone ) ]
8177/// Structure representing a `datetime.date`
8278pub struct PyDateTime_Date {
8379 pub ob_base : PyObject ,
@@ -91,7 +87,6 @@ pub struct PyDateTime_Date {
9187
9288#[ cfg( not( any( PyPy , GraalPy ) ) ) ]
9389#[ repr( C ) ]
94- #[ derive( Debug , Copy , Clone ) ]
9590/// Structure representing a `datetime.datetime` without a `tzinfo` member.
9691pub struct _PyDateTime_BaseDateTime {
9792 pub ob_base : PyObject ,
@@ -101,7 +96,6 @@ pub struct _PyDateTime_BaseDateTime {
10196}
10297
10398#[ repr( C ) ]
104- #[ derive( Debug , Copy , Clone ) ]
10599/// Structure representing a `datetime.datetime`.
106100pub struct PyDateTime_DateTime {
107101 pub ob_base : PyObject ,
@@ -130,26 +124,26 @@ pub struct PyDateTime_DateTime {
130124/// Returns a signed integer greater than 0.
131125pub unsafe fn PyDateTime_GET_YEAR ( o : * mut PyObject ) -> c_int {
132126 // 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 ] )
135129}
136130
137131#[ inline]
138132#[ cfg( not( any( PyPy , GraalPy ) ) ) ]
139133/// Retrieve the month component of a `PyDateTime_Date` or `PyDateTime_DateTime`.
140134/// Returns a signed integer in the range `[1, 12]`.
141135pub 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 ] )
144138}
145139
146140#[ inline]
147141#[ cfg( not( any( PyPy , GraalPy ) ) ) ]
148142/// Retrieve the day component of a `PyDateTime_Date` or `PyDateTime_DateTime`.
149143/// Returns a signed integer in the interval `[1, 31]`.
150144pub 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 ] )
153147}
154148
155149// Accessor macros for times
0 commit comments