Crates.io | or-iterator |
lib.rs | or-iterator |
version | 0.1.1 |
source | src |
created_at | 2020-05-02 14:28:19.440208 |
updated_at | 2020-05-02 14:45:15.75436 |
description | Rust iterator which takes two iterators and returns non-empty one |
homepage | |
repository | https://github.com/panarch/or-iterator |
max_upload_size | |
id | 236581 |
size | 9,734 |
Rust iterator which takes two iterators and return not empty one
use or_iterator::OrIterator;
let v1 = vec![1, 2, 3];
let v2 = vec![4, 5];
let or = v1.iter().or(v2.iter());
assert_eq!(3, or.count());
let v1 = vec![];
let v2 = vec![4, 5];
let or = v1.iter().or(v2.iter());
assert_eq!(2, or.count());
Frank Steffahn (https://internals.rust-lang.org/u/steffahn)