rust/src/libcore/iter
Joshua Nelson 822ad87325
Add Peekable::next_if
Prior art:

`rust_analyzer` uses
[`Parser::eat`](50f4ae798b/crates/ra_parser/src/parser.rs (L94)), which is `next_if` specialized to
`|y| next_if(|x| x == y)`.

Basically every other parser I've run into in Rust has an equivalent of
Parser::eat; see for example

- [cranelift](94190d5724/cranelift/reader/src/parser.rs (L498))
- [rcc](a8159c3904/src/parse/mod.rs (L231))
- [crunch](8521874fab/crates/crunch-parser/src/parser/mod.rs (L213-L241))
2020-05-26 18:55:18 -07:00
..
adapters Add Peekable::next_if 2020-05-26 18:55:18 -07:00
traits Rollup merge of #72166 - nnethercote:simpler-slice-Iterator-methods, r=cuviper 2020-05-16 12:43:01 +02:00
mod.rs Improve documentation on iterators 2020-02-16 17:12:26 +01:00
range.rs Auto merge of #69659 - CAD97:step-rework-take-3, r=Amanieu 2020-05-15 11:24:50 +00:00
sources.rs Stop accessing module level int consts via crate::<Ty> 2020-04-20 23:38:06 +02:00