Skip to content

Commit

Permalink
fix pad_integral example
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed May 23, 2021
1 parent 6e92fb4 commit 7c0db6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/core/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,12 +1245,13 @@ impl<'a> Formatter<'a> {
/// // We need to remove "-" from the number output.
/// let tmp = self.nb.abs().to_string();
///
/// formatter.pad_integral(self.nb > 0, "Foo ", &tmp)
/// formatter.pad_integral(self.nb >= 0, "Foo ", &tmp)
/// }
/// }
///
/// assert_eq!(&format!("{}", Foo::new(2)), "2");
/// assert_eq!(&format!("{}", Foo::new(-1)), "-1");
/// assert_eq!(&format!("{}", Foo::new(0)), "0");
/// assert_eq!(&format!("{:#}", Foo::new(-1)), "-Foo 1");
/// assert_eq!(&format!("{:0>#8}", Foo::new(-1)), "00-Foo 1");
/// ```
Expand Down

0 comments on commit 7c0db6f

Please sign in to comment.