Uh oh!
There was an error while loading. Please reload this page.
Change how the 0 flag works in format! - #40241
Conversation
rust-highfive
commented
Mar 3, 2017
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
Sawyer47
commented
Mar 3, 2017
Please don't merge it yet as I completely forgot about floats. I was slightly misled by the current documentation of |
Sawyer47
commented
Mar 4, 2017
I updated the logic for floats as well. |
alexcrichton
commented
Mar 6, 2017
Thanks for the PR @Sawyer47! I've tagged this with |
alexcrichton
commented
Mar 6, 2017
@rust-lang/libs if you've got opinions ahead of time, feel free to comment here! I'm fine landing this PR personally. |
alexcrichton
commented
Mar 14, 2017
bors
commented
Mar 14, 2017
📌 Commit 6652cef has been approved by |
bors
commented
Mar 15, 2017
🔒 Merge conflict |
Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits. :05 :<05 :>05 :^05 before |-0001| |-1000| |-0001| |-0100| after |-0001| |-0001| |-0001| |-0001| :#05x :<#05x :>#05x :^#05x before |0x001| |0x100| |000x1| |0x010| after |0x001| |0x001| |0x001| |0x001| Fixesrust-lang#39997 [breaking-change]
Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. :06 :<06 :>06 :^06 before |-001.2| |-1.200| |-001.2| |-01.20| after |-001.2| |-001.2| |-001.2| |-001.2|
alexcrichton
commented
Mar 15, 2017
@bors: r+ |
bors
commented
Mar 15, 2017
📌 Commit 8065486 has been approved by |
Change how the `0` flag works in format! Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits. Here's a short summary of how similar format strings work in Python and Rust: ``` :05 :<05 :>05 :^05 Python 3.6 |-0001| |-1000| |000-1| |0-100| Rust before |-0001| |-1000| |-0001| |-0100| Rust after |-0001| |-0001| |-0001| |-0001| :#05x :<#05x :>#05x :^#05x Python 3.6 |0x001| |0x100| |000x1| |00x10| Rust before |0x001| |0x100| |000x1| |0x010| Rust after |0x001| |0x001| |0x001| |0x001| ``` Fixesrust-lang#39997 [breaking-change]
Change how the `0` flag works in format! Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits. Here's a short summary of how similar format strings work in Python and Rust: ``` :05 :<05 :>05 :^05 Python 3.6 |-0001| |-1000| |000-1| |0-100| Rust before |-0001| |-1000| |-0001| |-0100| Rust after |-0001| |-0001| |-0001| |-0001| :#05x :<#05x :>#05x :^#05x Python 3.6 |0x001| |0x100| |000x1| |00x10| Rust before |0x001| |0x100| |000x1| |0x010| Rust after |0x001| |0x001| |0x001| |0x001| ``` Fixesrust-lang#39997 [breaking-change]
Change how the `0` flag works in format! Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits. Here's a short summary of how similar format strings work in Python and Rust: ``` :05 :<05 :>05 :^05 Python 3.6 |-0001| |-1000| |000-1| |0-100| Rust before |-0001| |-1000| |-0001| |-0100| Rust after |-0001| |-0001| |-0001| |-0001| :#05x :<#05x :>#05x :^#05x Python 3.6 |0x001| |0x100| |000x1| |00x10| Rust before |0x001| |0x100| |000x1| |0x010| Rust after |0x001| |0x001| |0x001| |0x001| ``` Fixesrust-lang#39997 [breaking-change]
Change how the `0` flag works in format! Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits. Here's a short summary of how similar format strings work in Python and Rust: ``` :05 :<05 :>05 :^05 Python 3.6 |-0001| |-1000| |000-1| |0-100| Rust before |-0001| |-1000| |-0001| |-0100| Rust after |-0001| |-0001| |-0001| |-0001| :#05x :<#05x :>#05x :^#05x Python 3.6 |0x001| |0x100| |000x1| |00x10| Rust before |0x001| |0x100| |000x1| |0x010| Rust after |0x001| |0x001| |0x001| |0x001| ``` Fixesrust-lang#39997 [breaking-change]
bors
commented
Mar 19, 2017
⌛ Testing commit 8065486 with merge bd14bc3... |
bors
commented
Mar 19, 2017
💔 Test failed - status-travis |
alexcrichton
commented
Mar 19, 2017
via email
| … On Sun, Mar 19, 2017 at 5:34 AM, bors ***@***.***> wrote:
💔 Test failed - status-travis
<https://travis-ci.org/rust-lang/rust/builds/212634242>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#40241 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95O4aItOnfxtKrvcmLh4JFesrGXtPks5rnQSegaJpZM4MSiVQ>
.
|
Change how the `0` flag works in format! Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits. Here's a short summary of how similar format strings work in Python and Rust: ``` :05 :<05 :>05 :^05 Python 3.6 |-0001| |-1000| |000-1| |0-100| Rust before |-0001| |-1000| |-0001| |-0100| Rust after |-0001| |-0001| |-0001| |-0001| :#05x :<#05x :>#05x :^#05x Python 3.6 |0x001| |0x100| |000x1| |00x10| Rust before |0x001| |0x100| |000x1| |0x010| Rust after |0x001| |0x001| |0x001| |0x001| ``` Fixesrust-lang#39997 [breaking-change]
bors
commented
Mar 20, 2017
⌛ Testing commit 8065486 with merge 9902af4... |
bors
commented
Mar 20, 2017
💔 Test failed - status-appveyor |
Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified
[[fill]align]. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits.Here's a short summary of how similar format strings work in Python and Rust:
Fixes#39997 [breaking-change]