concat 0.1.0

A reader adaptor that wraps around an iterator of readers and exposes their contents sequentially, i.e. concatenated.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![cfg(test)]

use super::concat;

use std::io::{Read, Cursor};
use std::iter::IntoIterator;

#[test]
fn it_concats() {
    let cursors = vec!["foo", "bar"].into_iter().map(str::as_bytes).map(Cursor::new);
    let mut concatd = String::new();

    concat(cursors).read_to_string(&mut concatd).unwrap();

    assert_eq!("foobar", concatd);
}