Skip to content

Commit 2d5dccc

Browse files
fmt fix
1 parent 46e7594 commit 2d5dccc

File tree

2 files changed

+46
-61717
lines changed

2 files changed

+46
-61717
lines changed

components/calendar/tests/date_optimized_snapshot.rs

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ fn test_generate_dates_and_durations_for_review() {
2828
AnyCalendarKind::Roc,
2929
];
3030

31-
3231
let iso_dates = vec![
3332
(2000, 1, 1),
3433
(2000, 2, 28),
@@ -41,7 +40,6 @@ fn test_generate_dates_and_durations_for_review() {
4140
(2004, 12, 31),
4241
];
4342

44-
4543
let mut durations: Vec<(i32, i32, i32)> = Vec::new();
4644

4745
for d in -65..=65 {
@@ -53,7 +51,13 @@ fn test_generate_dates_and_durations_for_review() {
5351
}
5452

5553
for md in -30..=30 {
56-
let day = if md < 0 { -1 } else if md == 0 { 0 } else { 1 };
54+
let day = if md < 0 {
55+
-1
56+
} else if md == 0 {
57+
0
58+
} else {
59+
1
60+
};
5761
durations.push((0, md, day));
5862
}
5963

@@ -62,21 +66,38 @@ fn test_generate_dates_and_durations_for_review() {
6266
}
6367

6468
for ym in -10..=10 {
65-
let month = if ym < 0 { -1 } else if ym == 0 { 0 } else { 1 };
69+
let month = if ym < 0 {
70+
-1
71+
} else if ym == 0 {
72+
0
73+
} else {
74+
1
75+
};
6676
durations.push((ym, month, 0));
6777
}
6878

6979
for yd in -10..=10 {
70-
let day = if yd < 0 { -1 } else if yd == 0 { 0 } else { 1 };
80+
let day = if yd < 0 {
81+
-1
82+
} else if yd == 0 {
83+
0
84+
} else {
85+
1
86+
};
7187
durations.push((yd, 0, day));
7288
}
7389

7490
for ymd in -10..=10 {
75-
let (month, day) = if ymd < 0 { (-1, -1) } else if ymd == 0 { (0, 0) } else { (1, 1) };
91+
let (month, day) = if ymd < 0 {
92+
(-1, -1)
93+
} else if ymd == 0 {
94+
(0, 0)
95+
} else {
96+
(1, 1)
97+
};
7698
durations.push((ymd, month, day));
7799
}
78100

79-
80101
let mut output = String::new();
81102

82103
writeln!(&mut output, "Durations total: {}", durations.len()).unwrap();
@@ -87,21 +108,33 @@ fn test_generate_dates_and_durations_for_review() {
87108
writeln!(&mut output, "Calendar: {:?}", cal_kind).unwrap();
88109

89110
for (y, m, d) in &iso_dates {
90-
91111
let start_date = Date::try_new_iso(*y, *m, *d)
92112
.expect("Valid ISO date")
93113
.to_calendar(cal.clone());
94114

95-
writeln!(&mut output, " START: {:04}-{:02}-{:02} -> {:?}", y, m, d, start_date)
96-
.unwrap();
115+
writeln!(
116+
&mut output,
117+
" START: {:04}-{:02}-{:02} -> {:?}",
118+
y, m, d, start_date
119+
)
120+
.unwrap();
97121

98-
99122
let show_n = 8usize;
100123
for (i, dur) in durations.iter().enumerate() {
101124
if i < show_n || i + show_n >= durations.len() {
102-
writeln!(&mut output, " +{:>4}Y {:>4}M {:>4}D", dur.0, dur.1, dur.2).unwrap();
125+
writeln!(
126+
&mut output,
127+
" +{:>4}Y {:>4}M {:>4}D",
128+
dur.0, dur.1, dur.2
129+
)
130+
.unwrap();
103131
} else if i == show_n {
104-
writeln!(&mut output, " ... {} omitted ...", durations.len() - (show_n * 2)).unwrap();
132+
writeln!(
133+
&mut output,
134+
" ... {} omitted ...",
135+
durations.len() - (show_n * 2)
136+
)
137+
.unwrap();
105138
}
106139
}
107140

@@ -111,7 +144,6 @@ fn test_generate_dates_and_durations_for_review() {
111144
writeln!(&mut output).unwrap();
112145
}
113146

114-
115147
assert!(!output.is_empty());
116148

117149
println!("{}", output);

0 commit comments

Comments
 (0)