Skip to content

toasty::create! should support struct field init shorthand (compilation broken after rustfmt) #649

Description

@leio

toasty::create!() should support struct field init shorthands in the argument, as it looks like a struct, and is also believed to be a struct by cargo fmt and co, so it makes it automatically use the shorthand, which then fails to compile

toasty::create!(User {
    first_name: first_name,
    last_name: last_name,
})
.exec(db)
.await?;

gets rewritten to

toasty::create!(User {
    first_name,
    last_name,
})
.exec(db)
.await?;

by a cargo fmt run, which in toasty 0.3 then fails to compile with

error: expected :

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