diff --git a/server/src/repository/encoding.rs b/server/src/repository/encoding.rs index 60271c0..fb47919 100644 --- a/server/src/repository/encoding.rs +++ b/server/src/repository/encoding.rs @@ -58,7 +58,8 @@ mod tests { fn round_trips_all_variants() { for direction in [Direction::In, Direction::Out] { let encoded = encode_direction(direction).to_owned(); - assert_eq!(decode_direction(encoded).unwrap(), direction); + let decoded = decode_direction(encoded.clone()).unwrap(); + assert_eq!(decoded, direction); } for unit in [ RecurrenceUnit::Day, @@ -67,14 +68,16 @@ mod tests { RecurrenceUnit::Year, ] { let encoded = encode_recurrence_unit(unit).to_owned(); - assert_eq!(decode_recurrence_unit(encoded).unwrap(), unit); + let decoded = decode_recurrence_unit(encoded.clone()).unwrap(); + assert_eq!(decoded, unit); } for adjustment in [ WeekendAdjustment::PreviousBusinessDay, WeekendAdjustment::NextBusinessDay, ] { let encoded = encode_weekend_adjustment(adjustment).to_owned(); - assert_eq!(decode_weekend_adjustment(encoded).unwrap(), adjustment); + let decoded = decode_weekend_adjustment(encoded.clone()).unwrap(); + assert_eq!(decoded, adjustment); } } diff --git a/server/src/repository/users.rs b/server/src/repository/users.rs index fa60072..66a3f2f 100644 --- a/server/src/repository/users.rs +++ b/server/src/repository/users.rs @@ -121,6 +121,7 @@ mod tests { #[test] fn round_trips_through_rows() { let user = decode(row()).unwrap(); - assert_eq!(decode(encode(user.clone())).unwrap(), user); + let round_trip = decode(encode(user.clone())).unwrap(); + assert_eq!(round_trip, user); } }