diff options
| author | bors <bors@rust-lang.org> | 2017-11-08 01:32:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-11-08 01:32:12 +0000 |
| commit | e177df3d5c4a5a9432f33f54ee459ea25bf7f2d2 (patch) | |
| tree | 5c5aa97363ed972bf2bc961534f4539d1264ca06 /src/rustllvm/RustWrapper.cpp | |
| parent | ee2286149a5f0b148334841d4f067dc819dcca3b (diff) | |
| parent | 68d05b2a073d2679ec1621ea1ebc49b7814cf250 (diff) | |
| download | rust-e177df3d5c4a5a9432f33f54ee459ea25bf7f2d2.tar.gz rust-e177df3d5c4a5a9432f33f54ee459ea25bf7f2d2.zip | |
Auto merge of #45379 - cuviper:unit_from_iter, r=alexcrichton
impl FromIterator<()> for ()
This just collapses all unit items from an iterator into one. This is
more useful when combined with higher-level abstractions, like
collecting to a `Result<(), E>` where you only care about errors:
```rust
use std::io::*;
data = vec![1, 2, 3, 4, 5];
let res: Result<()> = data.iter()
.map(|x| writeln!(stdout(), "{}", x))
.collect();
assert!(res.is_ok());
```
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
