Skip to content

Naming arguments in Fn traits #2812

Open
@elichai

Description

@elichai

Hi,
Right now If there's a Fn* trait that has 2 parameters of the same type it's really easy to confuse which is which.
i.e.:

type Callback = FnMut(&[u8], &[u8]) -> Point;

If we could name the arguments it would become easier to read and harder to misuse.

type Callback = FnMut(x: &[u8], y: &[u8]) -> Point;

Metadata

Metadata

Assignees

Labels

A-function-pointersProposals relating to function pointers.A-syntaxSyntax related proposals & ideasT-langRelevant to the language team, which will review and decide on the RFC.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions