use array_windows instead of windows in the compiler

This commit is contained in:
Bastian Kauschke 2020-09-17 09:28:14 +02:00
parent 255a4c58f5
commit 3435683fd5
11 changed files with 21 additions and 17 deletions

View file

@ -8,6 +8,7 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
#![allow(incomplete_features)]
#![feature(array_windows)]
#![feature(control_flow_enum)]
#![feature(in_band_lifetimes)]
#![feature(unboxed_closures)]

View file

@ -34,7 +34,7 @@ impl<K: Ord, V> SortedMap<K, V> {
/// and that there are no duplicates.
#[inline]
pub fn from_presorted_elements(elements: Vec<(K, V)>) -> SortedMap<K, V> {
debug_assert!(elements.windows(2).all(|w| w[0].0 < w[1].0));
debug_assert!(elements.array_windows().all(|[fst, snd]| fst.0 < snd.0));
SortedMap { data: elements }
}
@ -159,7 +159,7 @@ impl<K: Ord, V> SortedMap<K, V> {
return;
}
debug_assert!(elements.windows(2).all(|w| w[0].0 < w[1].0));
debug_assert!(elements.array_windows().all(|[fst, snd]| fst.0 < snd.0));
let start_index = self.lookup_index_for(&elements[0].0);