Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upShorten type param names #261
Conversation
This comment has been minimized.
This comment has been minimized.
|
I'm not fond of changing |
nikomatsakis
reviewed
Mar 15, 2017
| @@ -24,9 +24,9 @@ pub fn new<M, FILTER_OP>(base: M, filter_op: FILTER_OP) -> FilterMap<M, FILTER_O | |||
| } | |||
| } | |||
|
|
|||
| impl<M, FILTER_OP, R> ParallelIterator for FilterMap<M, FILTER_OP> | |||
| impl<M, P, R> ParallelIterator for FilterMap<M, P> | |||
This comment has been minimized.
This comment has been minimized.
nikomatsakis
Mar 15, 2017
Member
I no longer recall why I used M for the "base" operations, but it doesn't seem terribly intuitive to me. I see that the standard library uses I, perhaps we should use that (after adopting @cuviper's suggestion to change ITEM to T)?
nikomatsakis
reviewed
Mar 15, 2017
| impl<'f, ITEM, MAPPED_ITEM, C, FILTER_OP> Consumer<ITEM> for FilterMapConsumer<'f, C, FILTER_OP> | ||
| where C: Consumer<MAPPED_ITEM>, | ||
| FILTER_OP: Fn(ITEM) -> Option<MAPPED_ITEM> + Sync + 'f | ||
| impl<'p, I, MI, C, P> Consumer<I> for FilterMapConsumer<'p, C, P> |
This comment has been minimized.
This comment has been minimized.
nikomatsakis
Mar 15, 2017
Member
If we were using T for Item, I think I'd prefer U for MAPPED_ITEM. If we're going into single letter territory, might as well go there, I guess. Somewhat oddly (to my mind), the standard library seems to adopt B for this purpose, though.
This comment has been minimized.
This comment has been minimized.
|
OK, looking over the changes, I'm torn. I do think the existing names like like |
This comment has been minimized.
This comment has been minimized.
|
I think those are good suggestions, ( There is a few other cases where I ended up with a 2 letter params. For About documentation on the param names, I'm not an expert Rust developer and this library is new to me so my opinion may be worthwhile here, having the name |
leshow
force-pushed the
leshow:master
branch
2 times, most recently
from
be7f731
to
85eb7a8
Mar 15, 2017
leshow
force-pushed the
leshow:master
branch
from
85eb7a8
to
6d0994a
Mar 16, 2017
This comment has been minimized.
This comment has been minimized.
|
Looks pretty good to me. I'm inclined to merge. |
This comment has been minimized.
This comment has been minimized.
|
@cuviper you want to give one more look, or are you satisfied? |
This comment has been minimized.
This comment has been minimized.
|
I'm happy with this. |
nikomatsakis
merged commit cb1f3a8
into
rayon-rs:master
Mar 16, 2017
1 check passed
cuviper
added a commit
to cuviper/rayon
that referenced
this pull request
Mar 16, 2017
This comment has been minimized.
This comment has been minimized.
|
Thank you! |
leshow commentedMar 15, 2017
I picked the most obvious letters to me. Mapping operations;
Ffor function, for anything that returns a bool;Pfor predicate, etc. I made sure to change the associated lifetimes to match up and fix any formatting changes. Let me know if there's anything you'd like to change.#249