Skip to content

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

Closed
@jethrogb

Description

@jethrogb
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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions