@@ -1618,6 +1618,7 @@ impl<'a> Formatter<'a> {
16181618 }
16191619
16201620 /// Flags for formatting
1621+ #[ must_use]
16211622 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
16221623 #[ rustc_deprecated(
16231624 since = "1.24.0" ,
@@ -1655,6 +1656,7 @@ impl<'a> Formatter<'a> {
16551656 /// assert_eq!(&format!("{:G>3}", Foo), "GGG");
16561657 /// assert_eq!(&format!("{:t>6}", Foo), "tttttt");
16571658 /// ```
1659+ #[ must_use]
16581660 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
16591661 pub fn fill ( & self ) -> char {
16601662 self . fill
@@ -1691,6 +1693,7 @@ impl<'a> Formatter<'a> {
16911693 /// assert_eq!(&format!("{:^}", Foo), "center");
16921694 /// assert_eq!(&format!("{}", Foo), "into the void");
16931695 /// ```
1696+ #[ must_use]
16941697 #[ stable( feature = "fmt_flags_align" , since = "1.28.0" ) ]
16951698 pub fn align ( & self ) -> Option < Alignment > {
16961699 match self . align {
@@ -1725,6 +1728,7 @@ impl<'a> Formatter<'a> {
17251728 /// assert_eq!(&format!("{:10}", Foo(23)), "Foo(23) ");
17261729 /// assert_eq!(&format!("{}", Foo(23)), "Foo(23)");
17271730 /// ```
1731+ #[ must_use]
17281732 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
17291733 pub fn width ( & self ) -> Option < usize > {
17301734 self . width
@@ -1755,6 +1759,7 @@ impl<'a> Formatter<'a> {
17551759 /// assert_eq!(&format!("{:.4}", Foo(23.2)), "Foo(23.2000)");
17561760 /// assert_eq!(&format!("{}", Foo(23.2)), "Foo(23.20)");
17571761 /// ```
1762+ #[ must_use]
17581763 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
17591764 pub fn precision ( & self ) -> Option < usize > {
17601765 self . precision
@@ -1785,6 +1790,7 @@ impl<'a> Formatter<'a> {
17851790 /// assert_eq!(&format!("{:+}", Foo(23)), "Foo(+23)");
17861791 /// assert_eq!(&format!("{}", Foo(23)), "Foo(23)");
17871792 /// ```
1793+ #[ must_use]
17881794 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
17891795 pub fn sign_plus ( & self ) -> bool {
17901796 self . flags & ( 1 << FlagV1 :: SignPlus as u32 ) != 0
@@ -1813,6 +1819,7 @@ impl<'a> Formatter<'a> {
18131819 /// assert_eq!(&format!("{:-}", Foo(23)), "-Foo(23)");
18141820 /// assert_eq!(&format!("{}", Foo(23)), "Foo(23)");
18151821 /// ```
1822+ #[ must_use]
18161823 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
18171824 pub fn sign_minus ( & self ) -> bool {
18181825 self . flags & ( 1 << FlagV1 :: SignMinus as u32 ) != 0
@@ -1840,6 +1847,7 @@ impl<'a> Formatter<'a> {
18401847 /// assert_eq!(&format!("{:#}", Foo(23)), "Foo(23)");
18411848 /// assert_eq!(&format!("{}", Foo(23)), "23");
18421849 /// ```
1850+ #[ must_use]
18431851 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
18441852 pub fn alternate ( & self ) -> bool {
18451853 self . flags & ( 1 << FlagV1 :: Alternate as u32 ) != 0
@@ -1865,6 +1873,7 @@ impl<'a> Formatter<'a> {
18651873 ///
18661874 /// assert_eq!(&format!("{:04}", Foo(23)), "23");
18671875 /// ```
1876+ #[ must_use]
18681877 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
18691878 pub fn sign_aware_zero_pad ( & self ) -> bool {
18701879 self . flags & ( 1 << FlagV1 :: SignAwareZeroPad as u32 ) != 0
0 commit comments