about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaurits van Riezen <12109031+mousetail@users.noreply.github.com>2022-09-07 14:01:30 +0200
committerGitHub <noreply@github.com>2022-09-07 14:01:30 +0200
commit1dac6da408dac324e51e2e615483c72e358d9725 (patch)
tree956cb8b97a63c8c7045619197ff28aa494db9a52
parent0568b0a3de4eb37bf187eb61a9f017ae0018ad8f (diff)
downloadrust-1dac6da408dac324e51e2e615483c72e358d9725.tar.gz
rust-1dac6da408dac324e51e2e615483c72e358d9725.zip
This example was broken
The provided example to the `sign_plus` method on `fmt` is broken, it displays the `-` sign twice for negative numbers.
-rw-r--r--library/core/src/fmt/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index 9d3e9abf557..0d370e38431 100644
--- a/library/core/src/fmt/mod.rs
+++ b/library/core/src/fmt/mod.rs
@@ -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)
     ///         }