rust-lang / rust-lang/rfcs

Naming arguments in Fn traits

Open
#2,812 7 comments 7 reactions 1 assignee View on GitHub

@petrochenkov is already working on this.

Since Nov 12, 2019.

A-function-pointers A-syntax T-lang
Dominant language
Markdown
Stars
6.6k
Forks
1.7k
Avg merge
16h 14m
Merged PRs (30d)
1

Description

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;

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.