Skip to content

Rust iterator which takes two iterators and return not empty one

License

Notifications You must be signed in to change notification settings

panarch/or-iterator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

or-iterator

Crates.io docs.rs License

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());

Thanks to

Frank Steffahn (https://internals.rust-lang.org/u/steffahn)

About

Rust iterator which takes two iterators and return not empty one

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages