@@ -80,7 +80,9 @@ impl<'a> DebugStruct<'a> {
8080 pub fn finish ( & mut self ) -> Result {
8181 if self . has_fields {
8282 let empty_spec = FormatSpec :: new ( ) ;
83- self . result = self . result . and_then ( |_| self . writer . write_str ( " }" , & empty_spec) ) ;
83+ self . result = self
84+ . result
85+ . and_then ( |_| self . writer . write_str ( " }" , & empty_spec) ) ;
8486 }
8587 self . result
8688 }
@@ -253,7 +255,10 @@ impl<'a> DebugSet<'a> {
253255
254256 /// Finishes output and returns any error encountered.
255257 pub fn finish ( & mut self ) -> Result {
256- self . inner . result = self . inner . result . and_then ( |_| self . inner . writer . write_str ( "}" , & FormatSpec :: new ( ) ) ) ;
258+ self . inner . result = self
259+ . inner
260+ . result
261+ . and_then ( |_| self . inner . writer . write_str ( "}" , & FormatSpec :: new ( ) ) ) ;
257262 self . inner . result
258263 }
259264}
@@ -323,7 +328,10 @@ impl<'a> DebugList<'a> {
323328
324329 /// Finishes output and returns any error encountered.
325330 pub fn finish ( & mut self ) -> Result {
326- self . inner . result = self . inner . result . and_then ( |_| self . inner . writer . write_str ( "]" , & FormatSpec :: new ( ) ) ) ;
331+ self . inner . result = self
332+ . inner
333+ . result
334+ . and_then ( |_| self . inner . writer . write_str ( "]" , & FormatSpec :: new ( ) ) ) ;
327335 self . inner . result
328336 }
329337}
@@ -420,7 +428,10 @@ impl<'a> DebugMap<'a> {
420428 F : FnOnce ( Writer ) -> Result ,
421429 {
422430 self . result = self . result . and_then ( |_| {
423- assert ! ( self . has_key, "attempted to format a map value before its key" ) ;
431+ assert ! (
432+ self . has_key,
433+ "attempted to format a map value before its key"
434+ ) ;
424435 value_fmt ( self . writer ) ?;
425436 self . has_key = false ;
426437 Ok ( ( ) )
@@ -446,7 +457,10 @@ impl<'a> DebugMap<'a> {
446457 /// Marks the map as non-exhaustive, indicating to the reader that there are some other entries that are not shown in the debug representation.
447458 pub fn finish_non_exhaustive ( & mut self ) -> Result {
448459 self . result = self . result . and_then ( |_| {
449- assert ! ( !self . has_key, "attempted to finish a map with a partial entry" ) ;
460+ assert ! (
461+ !self . has_key,
462+ "attempted to finish a map with a partial entry"
463+ ) ;
450464
451465 let empty_spec = FormatSpec :: new ( ) ;
452466 if self . has_fields {
@@ -466,7 +480,10 @@ impl<'a> DebugMap<'a> {
466480 /// Otherwise this method will panic.
467481 pub fn finish ( & mut self ) -> Result {
468482 self . result = self . result . and_then ( |_| {
469- assert ! ( !self . has_key, "attempted to finish a map with a partial entry" ) ;
483+ assert ! (
484+ !self . has_key,
485+ "attempted to finish a map with a partial entry"
486+ ) ;
470487 let empty_spec = FormatSpec :: new ( ) ;
471488 self . writer . write_str ( "}" , & empty_spec)
472489 } ) ;
@@ -542,7 +559,9 @@ mod tests {
542559
543560 let mut writer = StringWriter :: new ( ) ;
544561 let spec = FormatSpec :: new ( ) ;
545- let _ = DebugStruct :: new ( & mut writer, & spec, "X" ) . finish ( ) . map_err ( |_| panic ! ( "failed to finish" ) ) ;
562+ let _ = DebugStruct :: new ( & mut writer, & spec, "X" )
563+ . finish ( )
564+ . map_err ( |_| panic ! ( "failed to finish" ) ) ;
546565
547566 assert_eq ! ( writer. get( ) , format!( "{:?}" , v) ) ;
548567 }
@@ -594,7 +613,9 @@ mod tests {
594613 fn test_tuple_empty_finish ( ) {
595614 let mut writer = StringWriter :: new ( ) ;
596615 let spec = FormatSpec :: new ( ) ;
597- let _ = DebugTuple :: new ( & mut writer, & spec, "" ) . finish ( ) . map_err ( |_| panic ! ( "failed to finish" ) ) ;
616+ let _ = DebugTuple :: new ( & mut writer, & spec, "" )
617+ . finish ( )
618+ . map_err ( |_| panic ! ( "failed to finish" ) ) ;
598619
599620 assert_eq ! ( writer. get( ) , "" ) ;
600621 }
@@ -730,7 +751,10 @@ mod tests {
730751 . finish_non_exhaustive ( )
731752 . map_err ( |_| panic ! ( "failed to finish" ) ) ;
732753
733- assert_eq ! ( writer. get( ) , "{\" first\" : 123, \" second\" : 456, \" third\" : 789, ..}" ) ;
754+ assert_eq ! (
755+ writer. get( ) ,
756+ "{\" first\" : 123, \" second\" : 456, \" third\" : 789, ..}"
757+ ) ;
734758 }
735759
736760 #[ test]
0 commit comments