@@ -51,7 +51,7 @@ pub trait FromConfig {
51
51
52
52
macro_rules! serialization_mode {
53
53
( $name: ident, $config_key: expr, $( $variant: ident => $value: expr) ,* $( , ) ?) => {
54
- #[ derive( Default , Debug , Clone , PartialEq , Eq ) ]
54
+ #[ derive( Default , Debug , Clone , Copy , PartialEq , Eq ) ]
55
55
pub ( crate ) enum $name {
56
56
#[ default ]
57
57
$( $variant, ) *
@@ -112,7 +112,7 @@ impl TimedeltaMode {
112
112
py_timedelta. call_method0 ( intern ! ( py_timedelta. py( ) , "total_seconds" ) )
113
113
}
114
114
115
- pub fn either_delta_to_json ( & self , py : Python , either_delta : & EitherTimedelta ) -> PyResult < PyObject > {
115
+ pub fn either_delta_to_json ( self , py : Python , either_delta : & EitherTimedelta ) -> PyResult < PyObject > {
116
116
match self {
117
117
Self :: Iso8601 => {
118
118
let d = either_delta. to_duration ( ) ?;
@@ -128,7 +128,7 @@ impl TimedeltaMode {
128
128
}
129
129
}
130
130
131
- pub fn json_key < ' py > ( & self , py : Python , either_delta : & EitherTimedelta ) -> PyResult < Cow < ' py , str > > {
131
+ pub fn json_key < ' py > ( self , py : Python , either_delta : & EitherTimedelta ) -> PyResult < Cow < ' py , str > > {
132
132
match self {
133
133
Self :: Iso8601 => {
134
134
let d = either_delta. to_duration ( ) ?;
@@ -143,7 +143,7 @@ impl TimedeltaMode {
143
143
}
144
144
145
145
pub fn timedelta_serialize < S : serde:: ser:: Serializer > (
146
- & self ,
146
+ self ,
147
147
py : Python ,
148
148
either_delta : & EitherTimedelta ,
149
149
serializer : S ,
@@ -164,7 +164,7 @@ impl TimedeltaMode {
164
164
}
165
165
166
166
impl BytesMode {
167
- pub fn bytes_to_string < ' a > ( & self , py : Python , bytes : & ' a [ u8 ] ) -> PyResult < Cow < ' a , str > > {
167
+ pub fn bytes_to_string < ' a > ( self , py : Python , bytes : & ' a [ u8 ] ) -> PyResult < Cow < ' a , str > > {
168
168
match self {
169
169
Self :: Utf8 => from_utf8 ( bytes)
170
170
. map_err ( |err| utf8_py_error ( py, err, bytes) )
@@ -176,7 +176,7 @@ impl BytesMode {
176
176
}
177
177
}
178
178
179
- pub fn serialize_bytes < S : serde:: ser:: Serializer > ( & self , bytes : & [ u8 ] , serializer : S ) -> Result < S :: Ok , S :: Error > {
179
+ pub fn serialize_bytes < S : serde:: ser:: Serializer > ( self , bytes : & [ u8 ] , serializer : S ) -> Result < S :: Ok , S :: Error > {
180
180
match self {
181
181
Self :: Utf8 => match from_utf8 ( bytes) {
182
182
Ok ( s) => serializer. serialize_str ( s) ,
0 commit comments