This example was broken

The provided example to the `sign_plus` method on `fmt` is broken, it displays the `-` sign twice for negative numbers.
This commit is contained in:
Maurits van Riezen 2022-09-07 14:01:30 +02:00 committed by GitHub
parent 0568b0a3de
commit 1dac6da408
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1819,7 +1819,7 @@ impl<'a> Formatter<'a> {
/// write!(formatter,
/// "Foo({}{})",
/// if self.0 < 0 { '-' } else { '+' },
/// self.0)
/// self.0.abs())
/// } else {
/// write!(formatter, "Foo({})", self.0)
/// }