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

Fix argument/where bound asymmetry. #76

Closed
ticki opened this issue Mar 24, 2017 · 1 comment
Closed

Fix argument/where bound asymmetry. #76

ticki opened this issue Mar 24, 2017 · 1 comment

Comments

@ticki
Copy link

ticki commented Mar 24, 2017

Argument lists can have multiple args on each line, which isn't true for where bounds in the proposed style. In particular, it isn't legal to do

    pub fn upsert<F, G>(&self, key: K, insert: F, update: G) // Multiple args here. (legal)
    where F: FnOnce() -> V, G: FnOnce(&mut V) { // Multiple bounds here. (NOT legal)
        // blah

related to #74

@nrc
Copy link
Member

nrc commented Mar 24, 2017

We discussed this in #38, to summarise, we think that single line where clauses only make sense if the bounds are very simple, otherwise they are hard to read (more so than arguments). However, if the clauses are this simple, then they are better as inline bounds on the generic arguments (which can be put on a single line). Therefore, there is no situation where single line where clauses with multiple clauses make sense.

(I'm closing because I think we discussed this in depth and we are happy with the asymmetry here. I don't think there is any new information here (c.f., #74, where it is perhaps worth re-considering single line where clauses with a single clause).

@nrc nrc closed this as completed Mar 24, 2017
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

No branches or pull requests

2 participants