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.
This commit is contained in:
parent
69c1a40aa9
commit
c10a57bf91
@ -2,7 +2,7 @@ Managed
|
|||||||
=======
|
=======
|
||||||
|
|
||||||
_managed_ is a library that provides a way to logically own objects, whether or not
|
_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
|
Motivation
|
||||||
----------
|
----------
|
||||||
@ -74,13 +74,13 @@ on the `std` crate.
|
|||||||
### Feature `alloc`
|
### Feature `alloc`
|
||||||
|
|
||||||
The `alloc` feature enables use of `Box`, `Vec`, and `BTreeMap` through a dependency
|
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`
|
### Feature `map`
|
||||||
|
|
||||||
The `map` feature, disabled by default, enables the `ManagedMap` enum.
|
The `map` feature, disabled by default, enables the `ManagedMap` enum.
|
||||||
Its interface is not stable yet and is subject to change.
|
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
|
Usage
|
||||||
-----
|
-----
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![cfg_attr(all(feature = "alloc", not(feature = "std")), feature(alloc))]
|
#![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
|
//! A library that provides a way to logically own objects, whether or not
|
||||||
//! heap allocation is available.
|
//! heap allocation is available.
|
||||||
|
@ -164,12 +164,12 @@ fn binary_search_by_key_range<'a, K, V, Q: 'a, R>(slice: &[Option<(K, V)>], rang
|
|||||||
|
|
||||||
// Find the beginning
|
// Find the beginning
|
||||||
let begin;
|
let begin;
|
||||||
if let Bound::Unbounded = range.start() {
|
if let Bound::Unbounded = range.start_bound() {
|
||||||
begin = 0;
|
begin = 0;
|
||||||
} else {
|
} else {
|
||||||
macro_rules! is_before_range {
|
macro_rules! is_before_range {
|
||||||
( $item: expr) => {
|
( $item: expr) => {
|
||||||
match &range.start() {
|
match &range.start_bound() {
|
||||||
Bound::Included(ref key_begin) => $item < Some(key_begin.borrow()),
|
Bound::Included(ref key_begin) => $item < Some(key_begin.borrow()),
|
||||||
Bound::Excluded(ref key_begin) => $item <= Some(key_begin.borrow()),
|
Bound::Excluded(ref key_begin) => $item <= Some(key_begin.borrow()),
|
||||||
Bound::Unbounded => unreachable!()
|
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
|
// Find the ending
|
||||||
let end;
|
let end;
|
||||||
if let Bound::Unbounded = range.end() {
|
if let Bound::Unbounded = range.end_bound() {
|
||||||
end = slice.len()
|
end = slice.len()
|
||||||
} else {
|
} else {
|
||||||
macro_rules! is_after_range {
|
macro_rules! is_after_range {
|
||||||
( $item:expr ) => {
|
( $item:expr ) => {
|
||||||
match &range.end() {
|
match &range.end_bound() {
|
||||||
Bound::Included(ref key_end) => $item > Some(key_end.borrow()),
|
Bound::Included(ref key_end) => $item > Some(key_end.borrow()),
|
||||||
Bound::Excluded(ref key_end) => $item >= Some(key_end.borrow()),
|
Bound::Excluded(ref key_end) => $item >= Some(key_end.borrow()),
|
||||||
Bound::Unbounded => unreachable!()
|
Bound::Unbounded => unreachable!()
|
||||||
|
Loading…
Reference in New Issue
Block a user