arrayvec: Use odds & bump version

This commit is contained in:
root
2015-06-02 17:28:53 +02:00
parent 7c92874782
commit ad22698464
3 changed files with 6 additions and 43 deletions
+2 -2
View File
@@ -1,3 +1,4 @@
extern crate odds;
extern crate nodrop;
use nodrop::NoDrop;
@@ -17,9 +18,8 @@ use std::hash::{Hash, Hasher};
use std::fmt;
mod array;
mod misc;
pub use array::Array;
pub use misc::RangeArgument;
pub use odds::IndexRange as RangeArgument;
use array::Index;
-40
View File
@@ -1,40 +0,0 @@
use std::ops::{
RangeFull,
RangeFrom,
RangeTo,
Range,
};
/// **RangeArgument** is implemented by Rust's built-in range types, produced
/// by range syntax like `..`, `a..`, `..b` or `c..d`.
pub trait RangeArgument {
#[inline]
#[doc(hidden)]
/// Start index (inclusive)
fn start(&self) -> Option<usize> { None }
#[inline]
#[doc(hidden)]
/// End index (exclusive)
fn end(&self) -> Option<usize> { None }
}
impl RangeArgument for RangeFull {}
impl RangeArgument for RangeFrom<usize> {
#[inline]
fn start(&self) -> Option<usize> { Some(self.start) }
}
impl RangeArgument for RangeTo<usize> {
#[inline]
fn end(&self) -> Option<usize> { Some(self.end) }
}
impl RangeArgument for Range<usize> {
#[inline]
fn start(&self) -> Option<usize> { Some(self.start) }
#[inline]
fn end(&self) -> Option<usize> { Some(self.end) }
}