Remove #![feature(collections_range)], as it is stable since Rust 1.28.

(Rust 1.28 is not yet released.)

Also, rename methods to reflect changes made during stabilization.
v0.7.x
whitequark 2018-05-31 18:02:01 +00:00
parent 69c1a40aa9
commit c10a57bf91
3 changed files with 7 additions and 8 deletions

View File

@ -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
-----

View File

@ -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.

View File

@ -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!()