Skip to content

assert_eq! has a terrible error message when given a trailing comma #39369

Closed
@cramertj

Description

@cramertj

Trailing commas are an easy mistake to make, especially in a language like Rust where they are often accepted. Erroneously adding a trailing comma to assert_eq! triggers the error message "requires at least a format string argument", which is confusing and leads the user to think (incorrectly) that they need to add some kind of format string. Example.

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