about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2017-10-18 23:12:37 -0700
committerJosh Stone <jistone@redhat.com>2017-10-18 23:12:37 -0700
commit68d05b2a073d2679ec1621ea1ebc49b7814cf250 (patch)
tree8ab664f4a4f9833cc0c97c8a9cbfe2f204d51b65 /src/libstd/sys
parentb7960878ba77124505aabe7dc99d0a898354c326 (diff)
downloadrust-68d05b2a073d2679ec1621ea1ebc49b7814cf250.tar.gz
rust-68d05b2a073d2679ec1621ea1ebc49b7814cf250.zip
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/libstd/sys')
0 files changed, 0 insertions, 0 deletions