From c4936340644aa3413d54b8e0859dcc84fd577f45 Mon Sep 17 00:00:00 2001 From: Matt Harding Date: Wed, 8 Nov 2023 14:56:35 +0000 Subject: [PATCH 1/3] Add link to Formatting traits from alternate forms --- library/alloc/src/fmt.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs index 1e2c35bf735f5..6f96a271442c3 100644 --- a/library/alloc/src/fmt.rs +++ b/library/alloc/src/fmt.rs @@ -188,6 +188,10 @@ //! * `#X` - precedes the argument with a `0x` //! * `#b` - precedes the argument with a `0b` //! * `#o` - precedes the argument with a `0o` +//! +//! See [Formatting traits](#formatting-traits) for a description of what the `?`, `x`, `X`, +//! `b`, and `o` flags do. +//! //! * `0` - This is used to indicate for integer formats that the padding to `width` should //! both be done with a `0` character as well as be sign-aware. A format //! like `{:08}` would yield `00000001` for the integer `1`, while the From 9bfe49e00a99d6e8c2f140d827717b596677f389 Mon Sep 17 00:00:00 2001 From: Matt Harding Date: Wed, 8 Nov 2023 15:41:45 +0000 Subject: [PATCH 2/3] Add note on how 0 flag overrides fill character --- library/alloc/src/fmt.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs index 6f96a271442c3..3697ee3d35097 100644 --- a/library/alloc/src/fmt.rs +++ b/library/alloc/src/fmt.rs @@ -201,6 +201,7 @@ //! and before the digits. When used together with the `#` flag, a similar //! rule applies: padding zeros are inserted after the prefix but before //! the digits. The prefix is included in the total width. +//! This flag overrides the [fill character and alignment flag](#fillalignment). //! //! ## Precision //! From 19caba0008895949e5db85202703958deb55dcdc Mon Sep 17 00:00:00 2001 From: Matt Harding Date: Thu, 9 Nov 2023 07:00:31 +0000 Subject: [PATCH 3/3] Remove trailing whitespace --- library/alloc/src/fmt.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs index 3697ee3d35097..05e89d879e6de 100644 --- a/library/alloc/src/fmt.rs +++ b/library/alloc/src/fmt.rs @@ -188,10 +188,10 @@ //! * `#X` - precedes the argument with a `0x` //! * `#b` - precedes the argument with a `0b` //! * `#o` - precedes the argument with a `0o` -//! +//! //! See [Formatting traits](#formatting-traits) for a description of what the `?`, `x`, `X`, //! `b`, and `o` flags do. -//! +//! //! * `0` - This is used to indicate for integer formats that the padding to `width` should //! both be done with a `0` character as well as be sign-aware. A format //! like `{:08}` would yield `00000001` for the integer `1`, while the