@@ -36,7 +36,11 @@ impl Case {
3636 self . time_closed . is_none ( )
3737 }
3838
39- pub fn display_indented ( & self , indent : usize , sitrep_id : Option < SitrepUuid > ) -> impl fmt:: Display + ' _ {
39+ pub fn display_indented (
40+ & self ,
41+ indent : usize ,
42+ sitrep_id : Option < SitrepUuid > ,
43+ ) -> impl fmt:: Display + ' _ {
4044 DisplayCase { case : self , indent, sitrep_id }
4145 }
4246}
@@ -119,24 +123,34 @@ impl fmt::Display for DisplayCase<'_> {
119123 } = self ;
120124
121125 let this_sitrep = move |s| {
122- if Some ( s) == sitrep_id {
123- " <-- this sitrep"
124- } else {
125- ""
126- }
126+ if Some ( s) == sitrep_id { " <-- this sitrep" } else { "" }
127127 } ;
128128
129129 writeln ! (
130130 f,
131131 "{:>indent$}case {id}" ,
132132 if indent > 0 { BULLET } else { "" }
133133 ) ?;
134- writeln ! ( f, "{:>indent$}-----------------------------------------" , "" ) ?;
134+ writeln ! (
135+ f,
136+ "{:>indent$}-----------------------------------------" ,
137+ ""
138+ ) ?;
135139 writeln ! ( f, "{:>indent$}diagnosis engine: {de}" , "" ) ?;
136- writeln ! ( f, "{:>indent$}created in sitrep: {created_sitrep_id}{}" , "" , this_sitrep( * created_sitrep_id) ) ?;
140+ writeln ! (
141+ f,
142+ "{:>indent$}created in sitrep: {created_sitrep_id}{}" ,
143+ "" ,
144+ this_sitrep( * created_sitrep_id)
145+ ) ?;
137146 writeln ! ( f, "{:>indent$} at: {time_created}" , "" ) ?;
138147 if let Some ( closed_id) = closed_sitrep_id {
139- writeln ! ( f, "{:>indent$}closed in sitrep: {closed_id}{}" , "" , this_sitrep( * closed_id) ) ?;
148+ writeln ! (
149+ f,
150+ "{:>indent$}closed in sitrep: {closed_id}{}" ,
151+ "" ,
152+ this_sitrep( * closed_id)
153+ ) ?;
140154 if let Some ( time_closed) = time_closed {
141155 writeln ! ( f, "{:>indent$} at: {time_closed}" , "" ) ?;
142156 } else {
@@ -172,7 +186,7 @@ impl fmt::Display for DisplayCase<'_> {
172186 f,
173187 "{:>indent$}added in sitrep: {assigned_sitrep_id}{}" ,
174188 "" ,
175- this_sitrep( * assigned_sitrep_id)
189+ this_sitrep( * assigned_sitrep_id)
176190 ) ?;
177191 writeln ! ( f, "{:>indent$}comment: {comment}\n " , "" ) ?;
178192 }
@@ -184,12 +198,12 @@ impl fmt::Display for DisplayCase<'_> {
184198 for ImpactedSpSlot { sp_type, slot, created_sitrep_id, comment } in
185199 impacted_sp_slots
186200 {
187- writeln ! ( f, "{BULLET:>indent$}{sp_type:<6} {slot:02 }" ) ?;
201+ writeln ! ( f, "{BULLET:>indent$}{sp_type:<6} {slot}" ) ?;
188202 writeln ! (
189203 f,
190204 "{:>indent$}added in sitrep: {created_sitrep_id}{}" ,
191205 "" ,
192- this_sitrep( * created_sitrep_id)
206+ this_sitrep( * created_sitrep_id)
193207 ) ?;
194208 writeln ! ( f, "{:>indent$}comment: {comment}\n " , "" ) ?;
195209 }
@@ -207,7 +221,7 @@ impl fmt::Display for DisplayCase<'_> {
207221 f,
208222 "{:>indent$}requested in sitrep: {requested_sitrep_id}{}\n " ,
209223 "" ,
210- this_sitrep( * requested_sitrep_id)
224+ this_sitrep( * requested_sitrep_id)
211225 ) ?;
212226 }
213227 }
0 commit comments