Skip to content

Commit 7c0db6f

Browse files
committed
fix pad_integral example
1 parent 6e92fb4 commit 7c0db6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/fmt/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1245,12 +1245,13 @@ impl<'a> Formatter<'a> {
12451245
/// // We need to remove "-" from the number output.
12461246
/// let tmp = self.nb.abs().to_string();
12471247
///
1248-
/// formatter.pad_integral(self.nb > 0, "Foo ", &tmp)
1248+
/// formatter.pad_integral(self.nb >= 0, "Foo ", &tmp)
12491249
/// }
12501250
/// }
12511251
///
12521252
/// assert_eq!(&format!("{}", Foo::new(2)), "2");
12531253
/// assert_eq!(&format!("{}", Foo::new(-1)), "-1");
1254+
/// assert_eq!(&format!("{}", Foo::new(0)), "0");
12541255
/// assert_eq!(&format!("{:#}", Foo::new(-1)), "-Foo 1");
12551256
/// assert_eq!(&format!("{:0>#8}", Foo::new(-1)), "00-Foo 1");
12561257
/// ```

0 commit comments

Comments
 (0)