Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document method-call expressions in pseudo-code as well as prose #1432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Dec 2, 2023

I personally find the documentation on method-call expressions very hard to grok, and I suspect I'm not the only one, so I thought I would attempt to rewrite the section in pseudo-code, to hopefully make the algorithm clearer.

This is done as a precursor to fixing #718 and #1018, which is important for RFC 3519 where we're trying to change the algorithm.


// Then, for each candidate `T`, add `&T` and `&mut T` to the list
// immediately after `T`.
let candidate_receiver_types = candidate_receiver_types.map(|T| [T, &T, &mut T]).flatten();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flat_map? I know this is just pseudo-Rust!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants