diff --git a/README.md b/README.md index 3a48300..007ec20 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Managed ======= _managed_ is a library that provides a way to logically own objects, whether or not -heap allocation is available. +heap allocation is available. It works with rustc 1.26 or later. Motivation ---------- @@ -74,13 +74,13 @@ on the `std` crate. ### Feature `alloc` The `alloc` feature enables use of `Box`, `Vec`, and `BTreeMap` through a dependency -on the `alloc` crate. This only works on nightly rustc. +on the `alloc` crate. It requires the use of nightly rustc. ### Feature `map` The `map` feature, disabled by default, enables the `ManagedMap` enum. Its interface is not stable yet and is subject to change. -It also requires the use of a nightly compiler, 1.27 or later. +It also requires the use of rustc 1.28 or later. Usage ----- diff --git a/src/lib.rs b/src/lib.rs index bf1c995..75de817 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,5 @@ #![no_std] #![cfg_attr(all(feature = "alloc", not(feature = "std")), feature(alloc))] -#![cfg_attr(feature = "map", feature(collections_range))] //! A library that provides a way to logically own objects, whether or not //! heap allocation is available. diff --git a/src/map.rs b/src/map.rs index be97b5b..47b833d 100644 --- a/src/map.rs +++ b/src/map.rs @@ -164,12 +164,12 @@ fn binary_search_by_key_range<'a, K, V, Q: 'a, R>(slice: &[Option<(K, V)>], rang // Find the beginning let begin; - if let Bound::Unbounded = range.start() { + if let Bound::Unbounded = range.start_bound() { begin = 0; } else { macro_rules! is_before_range { ( $item: expr) => { - match &range.start() { + match &range.start_bound() { Bound::Included(ref key_begin) => $item < Some(key_begin.borrow()), Bound::Excluded(ref key_begin) => $item <= Some(key_begin.borrow()), Bound::Unbounded => unreachable!() @@ -195,12 +195,12 @@ fn binary_search_by_key_range<'a, K, V, Q: 'a, R>(slice: &[Option<(K, V)>], rang // Find the ending let end; - if let Bound::Unbounded = range.end() { + if let Bound::Unbounded = range.end_bound() { end = slice.len() } else { macro_rules! is_after_range { ( $item:expr ) => { - match &range.end() { + match &range.end_bound() { Bound::Included(ref key_end) => $item > Some(key_end.borrow()), Bound::Excluded(ref key_end) => $item >= Some(key_end.borrow()), Bound::Unbounded => unreachable!()