You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
use std::iter::FusedIterator;
|
|
|
|
use std::collections::BTreeSet;
|
|
|
|
use std::borrow::Borrow;
|
|
|
|
use futures::prelude::*;
|
|
|
|
|
|
|
|
mod iters;
|
|
|
|
pub use iters::*;
|
|
|
|
|
|
|
|
mod streams;
|
|
|
|
pub use streams::*;
|
|
|
|
|
|
|
|
mod hashers;
|
|
|
|
pub use hashers::*;
|
|
|
|
|
|
|
|
pub const PRECOLLECT_STACK_SIZE: usize = 64;
|
|
|
|
|
|
|
|
/// Collect an iterator's output and then drop it to detach the iterator from any references or resources it might have.
|
|
|
|
#[macro_export] macro_rules! precollect {
|
|
|
|
($iter:expr, $num:literal) => {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let it: ::smallvec::SmallVec<[_; $num]> = $iter.into_iter().collect();
|
|
|
|
it.into_iter()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
($iter:expr) => {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let it: ::smallvec::SmallVec<[_; $crate::ext::PRECOLLECT_STACK_SIZE]> = $iter.into_iter().collect();
|
|
|
|
it.into_iter()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[macro_export] macro_rules! no_op {
|
|
|
|
($expr:expr) => {
|
|
|
|
{
|
|
|
|
$expr;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|