@@ -61,7 +61,8 @@ pub struct DebugStruct<'a, 'b: 'a> {
6161 has_fields : bool ,
6262}
6363
64- pub fn debug_struct_new < ' a , ' b > ( fmt : & ' a mut fmt:: Formatter < ' b > , name : & str )
64+ pub fn debug_struct_new < ' a , ' b > ( fmt : & ' a mut fmt:: Formatter < ' b > ,
65+ name : & str )
6566 -> DebugStruct < ' a , ' b > {
6667 let result = fmt. write_str ( name) ;
6768 DebugStruct {
@@ -84,7 +85,8 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
8485
8586 if self . is_pretty ( ) {
8687 let mut writer = PadAdapter :: new ( self . fmt ) ;
87- fmt:: write ( & mut writer, format_args ! ( "{}\n {}: {:#?}" , prefix, name, value) )
88+ fmt:: write ( & mut writer,
89+ format_args ! ( "{}\n {}: {:#?}" , prefix, name, value) )
8890 } else {
8991 write ! ( self . fmt, "{} {}: {:?}" , prefix, name, value)
9092 }
@@ -195,10 +197,18 @@ impl<'a, 'b: 'a> DebugInner<'a, 'b> {
195197 self . result = self . result . and_then ( |_| {
196198 if self . is_pretty ( ) {
197199 let mut writer = PadAdapter :: new ( self . fmt ) ;
198- let prefix = if self . has_fields { "," } else { "" } ;
200+ let prefix = if self . has_fields {
201+ ","
202+ } else {
203+ ""
204+ } ;
199205 fmt:: write ( & mut writer, format_args ! ( "{}\n {:#?}" , prefix, entry) )
200206 } else {
201- let prefix = if self . has_fields { ", " } else { "" } ;
207+ let prefix = if self . has_fields {
208+ ", "
209+ } else {
210+ ""
211+ } ;
202212 write ! ( self . fmt, "{}{:?}" , prefix, entry)
203213 }
204214 } ) ;
@@ -207,7 +217,11 @@ impl<'a, 'b: 'a> DebugInner<'a, 'b> {
207217 }
208218
209219 pub fn finish ( & mut self ) {
210- let prefix = if self . is_pretty ( ) && self . has_fields { "\n " } else { "" } ;
220+ let prefix = if self . is_pretty ( ) && self . has_fields {
221+ "\n "
222+ } else {
223+ ""
224+ } ;
211225 self . result = self . result . and_then ( |_| self . fmt . write_str ( prefix) ) ;
212226 }
213227
@@ -232,7 +246,7 @@ pub fn debug_set_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugSet<'a, 'b
232246 fmt : fmt,
233247 result : result,
234248 has_fields : false ,
235- }
249+ } ,
236250 }
237251}
238252
@@ -247,7 +261,9 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
247261 /// Adds the contents of an iterator of entries to the set output.
248262 #[ stable( feature = "debug_builders" , since = "1.2.0" ) ]
249263 pub fn entries < D , I > ( & mut self , entries : I ) -> & mut DebugSet < ' a , ' b >
250- where D : fmt:: Debug , I : IntoIterator < Item =D > {
264+ where D : fmt:: Debug ,
265+ I : IntoIterator < Item = D >
266+ {
251267 for entry in entries {
252268 self . entry ( & entry) ;
253269 }
@@ -278,7 +294,7 @@ pub fn debug_list_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugList<'a,
278294 fmt : fmt,
279295 result : result,
280296 has_fields : false ,
281- }
297+ } ,
282298 }
283299}
284300
@@ -293,7 +309,9 @@ impl<'a, 'b: 'a> DebugList<'a, 'b> {
293309 /// Adds the contents of an iterator of entries to the list output.
294310 #[ stable( feature = "debug_builders" , since = "1.2.0" ) ]
295311 pub fn entries < D , I > ( & mut self , entries : I ) -> & mut DebugList < ' a , ' b >
296- where D : fmt:: Debug , I : IntoIterator < Item =D > {
312+ where D : fmt:: Debug ,
313+ I : IntoIterator < Item = D >
314+ {
297315 for entry in entries {
298316 self . entry ( & entry) ;
299317 }
@@ -335,10 +353,19 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
335353 self . result = self . result . and_then ( |_| {
336354 if self . is_pretty ( ) {
337355 let mut writer = PadAdapter :: new ( self . fmt ) ;
338- let prefix = if self . has_fields { "," } else { "" } ;
339- fmt:: write ( & mut writer, format_args ! ( "{}\n {:#?}: {:#?}" , prefix, key, value) )
356+ let prefix = if self . has_fields {
357+ ","
358+ } else {
359+ ""
360+ } ;
361+ fmt:: write ( & mut writer,
362+ format_args ! ( "{}\n {:#?}: {:#?}" , prefix, key, value) )
340363 } else {
341- let prefix = if self . has_fields { ", " } else { "" } ;
364+ let prefix = if self . has_fields {
365+ ", "
366+ } else {
367+ ""
368+ } ;
342369 write ! ( self . fmt, "{}{:?}: {:?}" , prefix, key, value)
343370 }
344371 } ) ;
@@ -350,7 +377,10 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
350377 /// Adds the contents of an iterator of entries to the map output.
351378 #[ stable( feature = "debug_builders" , since = "1.2.0" ) ]
352379 pub fn entries < K , V , I > ( & mut self , entries : I ) -> & mut DebugMap < ' a , ' b >
353- where K : fmt:: Debug , V : fmt:: Debug , I : IntoIterator < Item =( K , V ) > {
380+ where K : fmt:: Debug ,
381+ V : fmt:: Debug ,
382+ I : IntoIterator < Item = ( K , V ) >
383+ {
354384 for ( k, v) in entries {
355385 self . entry ( & k, & v) ;
356386 }
@@ -360,7 +390,11 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
360390 /// Finishes output and returns any error encountered.
361391 #[ stable( feature = "debug_builders" , since = "1.2.0" ) ]
362392 pub fn finish ( & mut self ) -> fmt:: Result {
363- let prefix = if self . is_pretty ( ) && self . has_fields { "\n " } else { "" } ;
393+ let prefix = if self . is_pretty ( ) && self . has_fields {
394+ "\n "
395+ } else {
396+ ""
397+ } ;
364398 self . result . and_then ( |_| write ! ( self . fmt, "{}}}" , prefix) )
365399 }
366400
0 commit comments