Skip to content

rusti: print() is not io::print() #6617

Closed
@kud1ing

Description

@kud1ing

print() in rusti behaves unexpected, compared to println():

rusti> let a = 42; println(fmt!("%d", a));
42
rusti> let a = 42; print(fmt!("%d", a));
~"42"

@cmr found there is a wrapper in librusti/wrapper.rs doing a io::println(fmt!("%?", result));.

This makes it easier to do a print(a) for any type, but it is overlaying io::print with a different behavior.
I am not sure, whether this wrapper is necessary, since a inspects the item in a similar way.

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