@@ -1355,11 +1355,11 @@ impl<'a> Formatter<'a> {
13551355 /// }
13561356 /// }
13571357 ///
1358- /// assert_eq!(& format!("{}", Foo::new(2)), "2");
1359- /// assert_eq!(& format!("{}", Foo::new(-1)), "-1");
1360- /// assert_eq!(& format!("{}", Foo::new(0)), "0");
1361- /// assert_eq!(& format!("{:#}", Foo::new(-1)), "-Foo 1");
1362- /// assert_eq!(& format!("{:0>#8}", Foo::new(-1)), "00-Foo 1");
1358+ /// assert_eq!(format!("{}", Foo::new(2)), "2");
1359+ /// assert_eq!(format!("{}", Foo::new(-1)), "-1");
1360+ /// assert_eq!(format!("{}", Foo::new(0)), "0");
1361+ /// assert_eq!(format!("{:#}", Foo::new(-1)), "-Foo 1");
1362+ /// assert_eq!(format!("{:0>#8}", Foo::new(-1)), "00-Foo 1");
13631363 /// ```
13641364 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
13651365 pub fn pad_integral ( & mut self , is_nonnegative : bool , prefix : & str , buf : & str ) -> Result {
@@ -1452,8 +1452,8 @@ impl<'a> Formatter<'a> {
14521452 /// }
14531453 /// }
14541454 ///
1455- /// assert_eq!(& format!("{Foo:<4}"), "Foo ");
1456- /// assert_eq!(& format!("{Foo:0>4}"), "0Foo");
1455+ /// assert_eq!(format!("{Foo:<4}"), "Foo ");
1456+ /// assert_eq!(format!("{Foo:0>4}"), "0Foo");
14571457 /// ```
14581458 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
14591459 pub fn pad ( & mut self , s : & str ) -> Result {
@@ -1636,8 +1636,8 @@ impl<'a> Formatter<'a> {
16361636 /// }
16371637 /// }
16381638 ///
1639- /// assert_eq!(& format!("{Foo}"), "Foo");
1640- /// assert_eq!(& format!("{Foo:0>8}"), "Foo");
1639+ /// assert_eq!(format!("{Foo}"), "Foo");
1640+ /// assert_eq!(format!("{Foo:0>8}"), "Foo");
16411641 /// ```
16421642 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
16431643 pub fn write_str ( & mut self , data : & str ) -> Result {
@@ -1659,8 +1659,8 @@ impl<'a> Formatter<'a> {
16591659 /// }
16601660 /// }
16611661 ///
1662- /// assert_eq!(& format!("{}", Foo(-1)), "Foo -1");
1663- /// assert_eq!(& format!("{:0>8}", Foo(2)), "Foo 2");
1662+ /// assert_eq!(format!("{}", Foo(-1)), "Foo -1");
1663+ /// assert_eq!(format!("{:0>8}", Foo(2)), "Foo 2");
16641664 /// ```
16651665 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
16661666 pub fn write_fmt ( & mut self , fmt : Arguments < ' _ > ) -> Result {
@@ -1703,8 +1703,8 @@ impl<'a> Formatter<'a> {
17031703 /// }
17041704 ///
17051705 /// // We set alignment to the right with ">".
1706- /// assert_eq!(& format!("{Foo:G>3}"), "GGG");
1707- /// assert_eq!(& format!("{Foo:t>6}"), "tttttt");
1706+ /// assert_eq!(format!("{Foo:G>3}"), "GGG");
1707+ /// assert_eq!(format!("{Foo:t>6}"), "tttttt");
17081708 /// ```
17091709 #[ must_use]
17101710 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
@@ -1738,10 +1738,10 @@ impl<'a> Formatter<'a> {
17381738 /// }
17391739 /// }
17401740 ///
1741- /// assert_eq!(& format!("{Foo:<}"), "left");
1742- /// assert_eq!(& format!("{Foo:>}"), "right");
1743- /// assert_eq!(& format!("{Foo:^}"), "center");
1744- /// assert_eq!(& format!("{Foo}"), "into the void");
1741+ /// assert_eq!(format!("{Foo:<}"), "left");
1742+ /// assert_eq!(format!("{Foo:>}"), "right");
1743+ /// assert_eq!(format!("{Foo:^}"), "center");
1744+ /// assert_eq!(format!("{Foo}"), "into the void");
17451745 /// ```
17461746 #[ must_use]
17471747 #[ stable( feature = "fmt_flags_align" , since = "1.28.0" ) ]
@@ -1767,16 +1767,16 @@ impl<'a> Formatter<'a> {
17671767 /// fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
17681768 /// if let Some(width) = formatter.width() {
17691769 /// // If we received a width, we use it
1770- /// write!(formatter, "{:width$}", & format!("Foo({})", self.0), width = width)
1770+ /// write!(formatter, "{:width$}", format!("Foo({})", self.0), width = width)
17711771 /// } else {
17721772 /// // Otherwise we do nothing special
17731773 /// write!(formatter, "Foo({})", self.0)
17741774 /// }
17751775 /// }
17761776 /// }
17771777 ///
1778- /// assert_eq!(& format!("{:10}", Foo(23)), "Foo(23) ");
1779- /// assert_eq!(& format!("{}", Foo(23)), "Foo(23)");
1778+ /// assert_eq!(format!("{:10}", Foo(23)), "Foo(23) ");
1779+ /// assert_eq!(format!("{}", Foo(23)), "Foo(23)");
17801780 /// ```
17811781 #[ must_use]
17821782 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
@@ -1806,8 +1806,8 @@ impl<'a> Formatter<'a> {
18061806 /// }
18071807 /// }
18081808 ///
1809- /// assert_eq!(& format!("{:.4}", Foo(23.2)), "Foo(23.2000)");
1810- /// assert_eq!(& format!("{}", Foo(23.2)), "Foo(23.20)");
1809+ /// assert_eq!(format!("{:.4}", Foo(23.2)), "Foo(23.2000)");
1810+ /// assert_eq!(format!("{}", Foo(23.2)), "Foo(23.20)");
18111811 /// ```
18121812 #[ must_use]
18131813 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
@@ -1837,9 +1837,9 @@ impl<'a> Formatter<'a> {
18371837 /// }
18381838 /// }
18391839 ///
1840- /// assert_eq!(& format!("{:+}", Foo(23)), "Foo(+23)");
1841- /// assert_eq!(& format!("{:+}", Foo(-23)), "Foo(-23)");
1842- /// assert_eq!(& format!("{}", Foo(23)), "Foo(23)");
1840+ /// assert_eq!(format!("{:+}", Foo(23)), "Foo(+23)");
1841+ /// assert_eq!(format!("{:+}", Foo(-23)), "Foo(-23)");
1842+ /// assert_eq!(format!("{}", Foo(23)), "Foo(23)");
18431843 /// ```
18441844 #[ must_use]
18451845 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
@@ -1867,8 +1867,8 @@ impl<'a> Formatter<'a> {
18671867 /// }
18681868 /// }
18691869 ///
1870- /// assert_eq!(& format!("{:-}", Foo(23)), "-Foo(23)");
1871- /// assert_eq!(& format!("{}", Foo(23)), "Foo(23)");
1870+ /// assert_eq!(format!("{:-}", Foo(23)), "-Foo(23)");
1871+ /// assert_eq!(format!("{}", Foo(23)), "Foo(23)");
18721872 /// ```
18731873 #[ must_use]
18741874 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
@@ -1895,8 +1895,8 @@ impl<'a> Formatter<'a> {
18951895 /// }
18961896 /// }
18971897 ///
1898- /// assert_eq!(& format!("{:#}", Foo(23)), "Foo(23)");
1899- /// assert_eq!(& format!("{}", Foo(23)), "23");
1898+ /// assert_eq!(format!("{:#}", Foo(23)), "Foo(23)");
1899+ /// assert_eq!(format!("{}", Foo(23)), "23");
19001900 /// ```
19011901 #[ must_use]
19021902 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
@@ -1922,7 +1922,7 @@ impl<'a> Formatter<'a> {
19221922 /// }
19231923 /// }
19241924 ///
1925- /// assert_eq!(& format!("{:04}", Foo(23)), "23");
1925+ /// assert_eq!(format!("{:04}", Foo(23)), "23");
19261926 /// ```
19271927 #[ must_use]
19281928 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
0 commit comments