pub fn gen_range<T: Clone + PartialOrd>(x: &[T]) -> Vec<Range<T>>
Expand description
Generate Range of Intervals
§Examples
extern crate peroxide;
use peroxide::fuga::*;
use std::ops::Range;
let x = vec![1, 2, 3, 4];
let r = gen_range(&x);
let answer = vec![
Range { start: 1, end: 2 },
Range { start: 2, end: 3 },
Range { start: 3, end: 4 },
];
assert_eq!(r, answer);