mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-14 01:25:54 +00:00
03c660633f
Don't make a single line chain when it is was multi line in the source; allow overflow of the last chain element onto the next lines without breaking the chain.
17 lines
558 B
Rust
17 lines
558 B
Rust
// rustfmt-chains_overflow_last: false
|
|
|
|
fn main() {
|
|
reader.lines()
|
|
.map(|line| line.ok().expect("Failed getting line."))
|
|
.take_while(|line| line_regex.is_match(&line))
|
|
.filter_map(|line| {
|
|
regex.captures_iter(&line)
|
|
.next()
|
|
.map(|capture| {
|
|
(capture.at(1).expect("Couldn\'t unwrap capture.").to_owned(),
|
|
capture.at(2).expect("Couldn\'t unwrap capture.").to_owned())
|
|
})
|
|
})
|
|
.collect();
|
|
}
|