Skip to content

Commit f05f9b1

Browse files
committed
Update signed formatting for numeric types in docs
Sign formatting is no longer controlled by a `Signed` trait. Instead, `pad_integral` is used and implemented for numeric types by default. Fixes #38677
1 parent 7f2d2af commit f05f9b1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/libcollections/fmt.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,10 @@
366366
//! These can all be interpreted as flags for a particular formatter.
367367
//!
368368
//! * `+` - This is intended for numeric types and indicates that the sign
369-
//! should always be printed. Positive signs are never printed by
370-
//! default, and the negative sign is only printed by default for the
371-
//! `Signed` trait. This flag indicates that the correct sign (`+` or `-`)
372-
//! should always be printed.
373-
//! * `-` - Currently not used
369+
//! (`+` or `-`) should always be printed. Positive signs are never
370+
//! printed by default. This behavior is controlled by the
371+
//! [`pad_integral`][pad_integral] method.
372+
//! * `-` - Currently not used.
374373
//! * `#` - This flag is indicates that the "alternate" form of printing should
375374
//! be used. The alternate forms are:
376375
//! * `#?` - pretty-print the `Debug` formatting
@@ -384,6 +383,8 @@
384383
//! same format would yield `-0000001` for the integer `-1`. Notice that
385384
//! the negative version has one fewer zero than the positive version.
386385
//!
386+
//! [pad_integral]: struct.Formatter.html#method.pad_integral
387+
//!
387388
//! ## Width
388389
//!
389390
//! This is a parameter for the "minimum width" that the format should take up.

0 commit comments

Comments
 (0)