Decide which methods to add to new `Range` types
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
There's been discussion on the tracking issue:
...about which methods to add to the new Range types. Let's continue that here.
@orlp said:
To see which iterator methods we may want to add to the new ranges, I did an informal search on Github using the following query:
language:rust NOT is:fork /\W\s*\(\s*\w*\s*\.\.=?\s*\w*\s*\)\s*.\s*method\s*\(/I matched on anything that looks like
( <> .. <> )or( <> ..= <> )that is not immediately preceded by some identifier character, to avoid matching things likevec.drain(..).map(_).Example for
map: search.This isn't perfect but captures a rough amount of usage. Just looking by the number of matches:
map: 65.8krev: 23.2kcollect: 9.9kfor_each: 8.5kstep_by: 8.3kfilter: 8.2kflat_map: 4.2kfold: 3.5kzip: 3.4kfilter_map: 1.6kfind: 1.5kchain: 1.4ktake_while: 1.1kall: 1.1kcycle: 0.7kenumerate: 0.6kscan: 0.4kproduct: 0.4kfind_map: 0.3kany: 0.3ksum: 0.2ktake: 0.2kskip: 0.1ktry_*: 0.1kmin*: 0.1kmax*: 0.1kmap_while: 0.1kposition: 0.1kskip_while: 0.1kcount: 0.1kreduce: 0.1knth: 0.1kunzip: 0I personally think
filteris a decent cut-off, which gives the inherent methodsmap,rev,collect,for_each,step_by,filter.
cc @orlp @pitaj @programmerjake
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the tracking issue #123741 and review the discussion and GitHub search results quoted here about iterator methods used on range expressions. Done means reaching and documenting a decision about which methods the new Range types should provide.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100