This is just nit picking.

This commit is contained in:
2026-10-08 22:29:41 +02:00
parent 4114496b39
commit 8c0b265783
2 changed files with 8 additions and 4 deletions
+6 -3
View File
@@ -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);
}
}
+2 -1
View File
@@ -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);
}
}