url-cleaner-engine 0.11.0

The engine behind URL Cleaner.
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Segment utilities.

use crate::util::*;

/// Gets the range of elements form `iter`.
///
/// Technically the things this is used for shouldn't be using this at all, but for now it works.
pub(crate) fn neg_vec_keep<I: IntoIterator>(iter: I, start: isize, end: Option<isize>) -> Option<Vec<I::Item>> {
    let mut ret=iter.into_iter().collect::<Vec<_>>();
    Some(ret.drain(neg_range(start, end, ret.len())?).collect())
}