Skip to content

formatting with alignment fails #98

Closed
@parkr

Description

@parkr

hey, I'm learning rust and re-writing a very basic cal in order to learn. ran into a strange formatting bug:

extern crate time;

fn main() {
    // not aligned (bug in TmFmt Display impl?)
    println!("{:>11}", time::now_utc().strftime("%B").ok().unwrap());
    // aligned properly when forced into a string
    println!("{:>11}", time::now_utc().strftime("%B").ok().unwrap().to_string());
}

know what's going on here? i don't think i should have to call .to_string() in order to get the alignment...?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions