We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e92fb4 commit 7c0db6fCopy full SHA for 7c0db6f
library/core/src/fmt/mod.rs
@@ -1245,12 +1245,13 @@ impl<'a> Formatter<'a> {
1245
/// // We need to remove "-" from the number output.
1246
/// let tmp = self.nb.abs().to_string();
1247
///
1248
- /// formatter.pad_integral(self.nb > 0, "Foo ", &tmp)
+ /// formatter.pad_integral(self.nb >= 0, "Foo ", &tmp)
1249
/// }
1250
1251
1252
/// assert_eq!(&format!("{}", Foo::new(2)), "2");
1253
/// assert_eq!(&format!("{}", Foo::new(-1)), "-1");
1254
+ /// assert_eq!(&format!("{}", Foo::new(0)), "0");
1255
/// assert_eq!(&format!("{:#}", Foo::new(-1)), "-Foo 1");
1256
/// assert_eq!(&format!("{:0>#8}", Foo::new(-1)), "00-Foo 1");
1257
/// ```
0 commit comments