@@ -51,7 +51,7 @@ pub trait FromConfig {
5151
5252macro_rules! serialization_mode {
5353 ( $name: ident, $config_key: expr, $( $variant: ident => $value: expr) ,* $( , ) ?) => {
54- #[ derive( Default , Debug , Clone , PartialEq , Eq ) ]
54+ #[ derive( Default , Debug , Clone , Copy , PartialEq , Eq ) ]
5555 pub ( crate ) enum $name {
5656 #[ default ]
5757 $( $variant, ) *
@@ -112,7 +112,7 @@ impl TimedeltaMode {
112112 py_timedelta. call_method0 ( intern ! ( py_timedelta. py( ) , "total_seconds" ) )
113113 }
114114
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 > {
116116 match self {
117117 Self :: Iso8601 => {
118118 let d = either_delta. to_duration ( ) ?;
@@ -128,7 +128,7 @@ impl TimedeltaMode {
128128 }
129129 }
130130
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 > > {
132132 match self {
133133 Self :: Iso8601 => {
134134 let d = either_delta. to_duration ( ) ?;
@@ -143,7 +143,7 @@ impl TimedeltaMode {
143143 }
144144
145145 pub fn timedelta_serialize < S : serde:: ser:: Serializer > (
146- & self ,
146+ self ,
147147 py : Python ,
148148 either_delta : & EitherTimedelta ,
149149 serializer : S ,
@@ -164,7 +164,7 @@ impl TimedeltaMode {
164164}
165165
166166impl 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 > > {
168168 match self {
169169 Self :: Utf8 => from_utf8 ( bytes)
170170 . map_err ( |err| utf8_py_error ( py, err, bytes) )
@@ -176,7 +176,7 @@ impl BytesMode {
176176 }
177177 }
178178
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 > {
180180 match self {
181181 Self :: Utf8 => match from_utf8 ( bytes) {
182182 Ok ( s) => serializer. serialize_str ( s) ,
0 commit comments