Skip to content

Add a Repr trait that's distinct from ToStr (or a repr() method on ToStr) #3437

Closed
@jesse99

Description

@jesse99

This simple unit test fails:

#[test]
fn test_int()
{
   let x = ~10;
   assert x.to_str() == ~"10";
}

because the returned string is actually ~"~10". That's rather surprising.

Same sort of thing occurs with path::Path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions