Skip to content

Commit 1dac6da

Browse files
authored
This example was broken
The provided example to the `sign_plus` method on `fmt` is broken, it displays the `-` sign twice for negative numbers.
1 parent 0568b0a commit 1dac6da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ impl<'a> Formatter<'a> {
18191819
/// write!(formatter,
18201820
/// "Foo({}{})",
18211821
/// if self.0 < 0 { '-' } else { '+' },
1822-
/// self.0)
1822+
/// self.0.abs())
18231823
/// } else {
18241824
/// write!(formatter, "Foo({})", self.0)
18251825
/// }

0 commit comments

Comments
 (0)