Skip to content

Display implementation for IpAddr doesn't respect width or alignment #66810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jethrogb opened this issue Nov 27, 2019 · 1 comment
Closed

Display implementation for IpAddr doesn't respect width or alignment #66810

jethrogb opened this issue Nov 27, 2019 · 1 comment
Labels
C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@jethrogb
Copy link
Contributor

fn main() {
    println!("{:?}", format!("{:<15}", std::net::Ipv4Addr::UNSPECIFIED));
    println!("{:?}", format!("{:>15}", std::net::Ipv4Addr::UNSPECIFIED));
}

produces

"0.0.0.0"
"0.0.0.0"

but I'd expect

"0.0.0.0        "
"        0.0.0.0"
@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Nov 27, 2019
bors added a commit that referenced this issue Dec 27, 2019
Implement padding for IpAddr without heap alloc

Implements padding for `IpAddr`s without heap allocations.
This fixes issue #66810 .

cc @jethrogb @mzohreva
@Goirad
Copy link
Contributor

Goirad commented Jan 2, 2020

This can be closed now, at least for nightly.

@jethrogb jethrogb closed this as completed Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants