@@ -50,7 +50,7 @@ impl Timestamp {
5050 ///
5151 /// [1]: https://github.com/google/protobuf/blob/v3.3.2/src/google/protobuf/util/time_util.cc#L59-L77
5252 pub fn try_normalize ( mut self ) -> Result < Timestamp , Timestamp > {
53- let before = self . clone ( ) ;
53+ let before = self ;
5454 self . normalize ( ) ;
5555 // If the seconds value has changed, and is either i64::MIN or i64::MAX, then the timestamp
5656 // normalization overflowed.
@@ -201,7 +201,7 @@ impl TryFrom<Timestamp> for std::time::SystemTime {
201201 type Error = TimestampError ;
202202
203203 fn try_from ( mut timestamp : Timestamp ) -> Result < std:: time:: SystemTime , Self :: Error > {
204- let orig_timestamp = timestamp. clone ( ) ;
204+ let orig_timestamp = timestamp;
205205 timestamp. normalize ( ) ;
206206
207207 let system_time = if timestamp. seconds >= 0 {
@@ -211,8 +211,7 @@ impl TryFrom<Timestamp> for std::time::SystemTime {
211211 timestamp
212212 . seconds
213213 . checked_neg ( )
214- . ok_or_else ( || TimestampError :: OutOfSystemRange ( timestamp. clone ( ) ) ) ?
215- as u64 ,
214+ . ok_or ( TimestampError :: OutOfSystemRange ( timestamp) ) ? as u64 ,
216215 ) )
217216 } ;
218217
@@ -234,7 +233,7 @@ impl FromStr for Timestamp {
234233
235234impl fmt:: Display for Timestamp {
236235 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
237- datetime:: DateTime :: from ( self . clone ( ) ) . fmt ( f)
236+ datetime:: DateTime :: from ( * self ) . fmt ( f)
238237 }
239238}
240239#[ cfg( test) ]
0 commit comments