Skip to content

Commit 7f80a4a

Browse files
committed
---
yaml --- r: 195260 b: refs/heads/tmp c: 842e6cf h: refs/heads/master v: v3
1 parent ca3158a commit 7f80a4a

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: d8be84eb4499e21bd98a3500c8760540996df23b
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: b82bcec7ce67a60adcc054670487fe534195f6d6
37+
refs/heads/tmp: 842e6cf63e632473b335cffeeaeb305c45d546fa
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3939
refs/tags/homu-tmp: 53a183f0274316596bf9405944d4f0468d8c93e4
4040
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/libcore/fmt/mod.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -692,11 +692,7 @@ impl<'a> Formatter<'a> {
692692
///
693693
/// impl fmt::Debug for Foo {
694694
/// fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
695-
/// let mut builder = fmt.debug_list();
696-
/// for i in &self.0 {
697-
/// builder = builder.entry(i);
698-
/// }
699-
/// builder.finish()
695+
/// self.0.iter().fold(fmt.debug_list(), |b, e| b.entry(e)).finish()
700696
/// }
701697
/// }
702698
///
@@ -722,11 +718,7 @@ impl<'a> Formatter<'a> {
722718
///
723719
/// impl fmt::Debug for Foo {
724720
/// fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
725-
/// let mut builder = fmt.debug_set();
726-
/// for i in &self.0 {
727-
/// builder = builder.entry(i);
728-
/// }
729-
/// builder.finish()
721+
/// self.0.iter().fold(fmt.debug_set(), |b, e| b.entry(e)).finish()
730722
/// }
731723
/// }
732724
///
@@ -752,11 +744,7 @@ impl<'a> Formatter<'a> {
752744
///
753745
/// impl fmt::Debug for Foo {
754746
/// fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
755-
/// let mut builder = fmt.debug_map();
756-
/// for &(ref key, ref value) in &self.0 {
757-
/// builder = builder.entry(key, value);
758-
/// }
759-
/// builder.finish()
747+
/// self.0.iter().fold(fmt.debug_map(), |b, (k, v)| b.entry(k, v)).finish()
760748
/// }
761749
/// }
762750
///

0 commit comments

Comments
 (0)