We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0d7ed1 commit f2ecf7cCopy full SHA for f2ecf7c
library/core/src/fmt/mod.rs
@@ -791,8 +791,10 @@ pub trait Octal {
791
/// assert_eq!(format!("l as binary is: {l:b}"), "l as binary is: 1101011");
792
///
793
/// assert_eq!(
794
-/// format!("l as binary is: {l:#032b}"),
795
-/// "l as binary is: 0b000000000000000000000001101011"
+/// // Note that the `0b` prefix added by `#` is included in the total width, so we
+/// // need to add two to correctly display all 32 bits.
796
+/// format!("l as binary is: {l:#034b}"),
797
+/// "l as binary is: 0b00000000000000000000000001101011"
798
/// );
799
/// ```
800
#[stable(feature = "rust1", since = "1.0.0")]
0 commit comments