summaryrefslogtreecommitdiff
path: root/rust/tail.rs
blob: 0a49b832e37c924f77934c40241180d21ff2db0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
fn tail<I>(mut iter: I) -> I
    where I: Iterator {
    iter.next();
    iter
}

fn main() {
    let xs = [1, 2, 3];
    let ys = tail(xs.iter());
    let zs = tail(ys);
    println!("{:?}", zs);
}