Skip to content

Default values for struct fields #1

Description

@nrc

Specify a default value for fields so that they don't need to be given in struct initialisers.

Points to consider:

  • syntax
  • type inference for field types?
  • which values are allowed as defaults
  • if a field implements Default, can we use that value somehow?
  • interaction with derive(Default)
  • interaction with .. in initialisers
  • some overlap with default arguments/keyword arguments

Previous discussion

Working directory: default-fields

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions