std: Rename various slice traits for consistency
ImmutableVector -> ImmutableSlice ImmutableEqVector -> ImmutableEqSlice ImmutableOrdVector -> ImmutableOrdSlice MutableVector -> MutableSlice MutableVectorAllocating -> MutableSliceAllocating MutableCloneableVector -> MutableCloneableSlice MutableOrdVector -> MutableOrdSlice These are all in the prelude so most code will not break. [breaking-change]
This commit is contained in:
parent
d917770792
commit
4f5b6927e8
src
libcollections
libcore
libregex
librlibc
libstd
libunicode
@ -296,7 +296,7 @@ mod tests {
|
||||
use std::prelude::*;
|
||||
use std::mem;
|
||||
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use super::{Hash, Hasher, Writer};
|
||||
|
||||
struct MyWriterHasher;
|
||||
|
@ -275,7 +275,7 @@ mod tests {
|
||||
|
||||
use str::Str;
|
||||
use string::String;
|
||||
use slice::{Vector, ImmutableVector};
|
||||
use slice::{Vector, ImmutableSlice};
|
||||
use vec::Vec;
|
||||
|
||||
use super::super::{Hash, Writer};
|
||||
|
@ -45,8 +45,8 @@ represents iteration over a slice.
|
||||
## Traits
|
||||
|
||||
A number of traits add methods that allow you to accomplish tasks with slices.
|
||||
These traits include `ImmutableVector`, which is defined for `&[T]` types,
|
||||
and `MutableVector`, defined for `&mut [T]` types.
|
||||
These traits include `ImmutableSlice`, which is defined for `&[T]` types,
|
||||
and `MutableSlice`, defined for `&mut [T]` types.
|
||||
|
||||
An example is the method `.slice(a, b)` that returns an immutable "view" into
|
||||
a `Vec` or another slice from the index interval `[a, b)`:
|
||||
@ -98,10 +98,10 @@ use {Collection, MutableSeq};
|
||||
use vec::Vec;
|
||||
|
||||
pub use core::slice::{ref_slice, mut_ref_slice, Splits, Windows};
|
||||
pub use core::slice::{Chunks, Vector, ImmutableVector, ImmutableEqVector};
|
||||
pub use core::slice::{ImmutableOrdVector, MutableVector, Items, MutItems};
|
||||
pub use core::slice::{Chunks, Vector, ImmutableSlice, ImmutableEqSlice};
|
||||
pub use core::slice::{ImmutableOrdSlice, MutableSlice, Items, MutItems};
|
||||
pub use core::slice::{MutSplits, MutChunks};
|
||||
pub use core::slice::{bytes, MutableCloneableVector};
|
||||
pub use core::slice::{bytes, MutableCloneableSlice};
|
||||
|
||||
// Functional utilities
|
||||
|
||||
@ -558,7 +558,7 @@ fn merge_sort<T>(v: &mut [T], compare: |&T, &T| -> Ordering) {
|
||||
|
||||
/// Extension methods for vectors such that their elements are
|
||||
/// mutable.
|
||||
pub trait MutableVectorAllocating<'a, T> {
|
||||
pub trait MutableSliceAllocating<'a, T> {
|
||||
/// Sort the vector, in place, using `compare` to compare
|
||||
/// elements.
|
||||
///
|
||||
@ -604,7 +604,7 @@ pub trait MutableVectorAllocating<'a, T> {
|
||||
fn move_from(self, src: Vec<T>, start: uint, end: uint) -> uint;
|
||||
}
|
||||
|
||||
impl<'a,T> MutableVectorAllocating<'a, T> for &'a mut [T] {
|
||||
impl<'a,T> MutableSliceAllocating<'a, T> for &'a mut [T] {
|
||||
#[inline]
|
||||
fn sort_by(self, compare: |&T, &T| -> Ordering) {
|
||||
merge_sort(self, compare)
|
||||
@ -621,7 +621,7 @@ impl<'a,T> MutableVectorAllocating<'a, T> for &'a mut [T] {
|
||||
|
||||
/// Methods for mutable vectors with orderable elements, such as
|
||||
/// in-place sorting.
|
||||
pub trait MutableOrdVector<T> {
|
||||
pub trait MutableOrdSlice<T> {
|
||||
/// Sort the vector, in place.
|
||||
///
|
||||
/// This is equivalent to `self.sort_by(|a, b| a.cmp(b))`.
|
||||
@ -667,7 +667,7 @@ pub trait MutableOrdVector<T> {
|
||||
fn prev_permutation(self) -> bool;
|
||||
}
|
||||
|
||||
impl<'a, T: Ord> MutableOrdVector<T> for &'a mut [T] {
|
||||
impl<'a, T: Ord> MutableOrdSlice<T> for &'a mut [T] {
|
||||
#[inline]
|
||||
fn sort(self) {
|
||||
self.sort_by(|a,b| a.cmp(b))
|
||||
|
@ -894,7 +894,7 @@ mod tests {
|
||||
use {Collection, MutableSeq};
|
||||
|
||||
use super::*;
|
||||
use std::slice::{Vector, ImmutableVector};
|
||||
use std::slice::{Vector, ImmutableSlice};
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
|
||||
|
@ -24,7 +24,7 @@ use core::ptr;
|
||||
use core::uint;
|
||||
|
||||
use {Collection, Mutable, MutableSeq};
|
||||
use slice::{MutableOrdVector, MutableVectorAllocating, CloneableVector};
|
||||
use slice::{MutableOrdSlice, MutableSliceAllocating, CloneableVector};
|
||||
use slice::{Items, MutItems};
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@ use iter::{range, DoubleEndedIterator};
|
||||
use num::{Float, FPNaN, FPInfinite, ToPrimitive, Primitive};
|
||||
use num::{Zero, One, cast};
|
||||
use result::Ok;
|
||||
use slice::{ImmutableVector, MutableVector};
|
||||
use slice::{ImmutableSlice, MutableSlice};
|
||||
use slice;
|
||||
use str::StrSlice;
|
||||
|
||||
|
@ -24,7 +24,7 @@ use option::{Option, Some, None};
|
||||
use ops::Deref;
|
||||
use result::{Ok, Err};
|
||||
use result;
|
||||
use slice::{Vector, ImmutableVector};
|
||||
use slice::{Vector, ImmutableSlice};
|
||||
use slice;
|
||||
use str::StrSlice;
|
||||
use str;
|
||||
|
@ -18,7 +18,7 @@ use collections::Collection;
|
||||
use fmt;
|
||||
use iter::DoubleEndedIterator;
|
||||
use num::{Int, cast, zero};
|
||||
use slice::{ImmutableVector, MutableVector};
|
||||
use slice::{ImmutableSlice, MutableSlice};
|
||||
|
||||
/// A type that represents a specific radix
|
||||
#[doc(hidden)]
|
||||
|
@ -61,6 +61,6 @@ pub use str::{Str, StrSlice};
|
||||
pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4};
|
||||
pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
|
||||
pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};
|
||||
pub use slice::{ImmutableEqVector, ImmutableOrdVector};
|
||||
pub use slice::{MutableVector};
|
||||
pub use slice::{Vector, ImmutableVector};
|
||||
pub use slice::{ImmutableEqSlice, ImmutableOrdSlice};
|
||||
pub use slice::{MutableSlice};
|
||||
pub use slice::{Vector, ImmutableSlice};
|
||||
|
@ -54,7 +54,7 @@ use raw::{Repr, Slice};
|
||||
//
|
||||
|
||||
/// Extension methods for vectors
|
||||
pub trait ImmutableVector<'a, T> {
|
||||
pub trait ImmutableSlice<'a, T> {
|
||||
/**
|
||||
* Returns a slice of self spanning the interval [`start`, `end`).
|
||||
*
|
||||
@ -234,7 +234,7 @@ pub trait ImmutableVector<'a, T> {
|
||||
fn pop_ref(&mut self) -> Option<&'a T>;
|
||||
}
|
||||
|
||||
impl<'a,T> ImmutableVector<'a, T> for &'a [T] {
|
||||
impl<'a,T> ImmutableSlice<'a, T> for &'a [T] {
|
||||
#[inline]
|
||||
fn slice(&self, start: uint, end: uint) -> &'a [T] {
|
||||
assert!(start <= end);
|
||||
@ -401,7 +401,7 @@ impl<'a,T> ImmutableVector<'a, T> for &'a [T] {
|
||||
|
||||
/// Extension methods for vectors such that their elements are
|
||||
/// mutable.
|
||||
pub trait MutableVector<'a, T> {
|
||||
pub trait MutableSlice<'a, T> {
|
||||
/// Returns a mutable reference to the element at the given index,
|
||||
/// or `None` if the index is out of bounds
|
||||
fn get_mut(self, index: uint) -> Option<&'a mut T>;
|
||||
@ -607,7 +607,7 @@ pub trait MutableVector<'a, T> {
|
||||
unsafe fn copy_memory(self, src: &[T]);
|
||||
}
|
||||
|
||||
impl<'a,T> MutableVector<'a, T> for &'a mut [T] {
|
||||
impl<'a,T> MutableSlice<'a, T> for &'a mut [T] {
|
||||
#[inline]
|
||||
fn get_mut(self, index: uint) -> Option<&'a mut T> {
|
||||
if index < self.len() { Some(&mut self[index]) } else { None }
|
||||
@ -755,7 +755,7 @@ impl<'a,T> MutableVector<'a, T> for &'a mut [T] {
|
||||
}
|
||||
|
||||
/// Extension methods for vectors contain `PartialEq` elements.
|
||||
pub trait ImmutableEqVector<T:PartialEq> {
|
||||
pub trait ImmutableEqSlice<T:PartialEq> {
|
||||
/// Find the first index containing a matching value
|
||||
fn position_elem(&self, t: &T) -> Option<uint>;
|
||||
|
||||
@ -772,7 +772,7 @@ pub trait ImmutableEqVector<T:PartialEq> {
|
||||
fn ends_with(&self, needle: &[T]) -> bool;
|
||||
}
|
||||
|
||||
impl<'a,T:PartialEq> ImmutableEqVector<T> for &'a [T] {
|
||||
impl<'a,T:PartialEq> ImmutableEqSlice<T> for &'a [T] {
|
||||
#[inline]
|
||||
fn position_elem(&self, x: &T) -> Option<uint> {
|
||||
self.iter().position(|y| *x == *y)
|
||||
@ -802,7 +802,7 @@ impl<'a,T:PartialEq> ImmutableEqVector<T> for &'a [T] {
|
||||
}
|
||||
|
||||
/// Extension methods for vectors containing `Ord` elements.
|
||||
pub trait ImmutableOrdVector<T: Ord> {
|
||||
pub trait ImmutableOrdSlice<T: Ord> {
|
||||
/**
|
||||
* Binary search a sorted vector for a given element.
|
||||
*
|
||||
@ -811,14 +811,14 @@ pub trait ImmutableOrdVector<T: Ord> {
|
||||
fn bsearch_elem(&self, x: &T) -> Option<uint>;
|
||||
}
|
||||
|
||||
impl<'a, T: Ord> ImmutableOrdVector<T> for &'a [T] {
|
||||
impl<'a, T: Ord> ImmutableOrdSlice<T> for &'a [T] {
|
||||
fn bsearch_elem(&self, x: &T) -> Option<uint> {
|
||||
self.bsearch(|p| p.cmp(x))
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for &[T] where T is Cloneable
|
||||
pub trait MutableCloneableVector<T> {
|
||||
pub trait MutableCloneableSlice<T> {
|
||||
/// Copies as many elements from `src` as it can into `self` (the
|
||||
/// shorter of `self.len()` and `src.len()`). Returns the number
|
||||
/// of elements copied.
|
||||
@ -826,7 +826,7 @@ pub trait MutableCloneableVector<T> {
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::slice::MutableCloneableVector;
|
||||
/// use std::slice::MutableCloneableSlice;
|
||||
///
|
||||
/// let mut dst = [0i, 0, 0];
|
||||
/// let src = [1i, 2];
|
||||
@ -841,7 +841,7 @@ pub trait MutableCloneableVector<T> {
|
||||
fn copy_from(self, &[T]) -> uint;
|
||||
}
|
||||
|
||||
impl<'a, T:Clone> MutableCloneableVector<T> for &'a mut [T] {
|
||||
impl<'a, T:Clone> MutableCloneableSlice<T> for &'a mut [T] {
|
||||
#[inline]
|
||||
fn copy_from(self, src: &[T]) -> uint {
|
||||
for (a, b) in self.mut_iter().zip(src.iter()) {
|
||||
@ -1413,7 +1413,7 @@ pub mod raw {
|
||||
pub mod bytes {
|
||||
use collections::Collection;
|
||||
use ptr;
|
||||
use slice::MutableVector;
|
||||
use slice::MutableSlice;
|
||||
|
||||
/// A trait for operations on mutable `[u8]`s.
|
||||
pub trait MutableByteVector {
|
||||
|
@ -30,7 +30,7 @@ use iter::range;
|
||||
use num::{CheckedMul, Saturating};
|
||||
use option::{Option, None, Some};
|
||||
use raw::Repr;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use slice;
|
||||
use uint;
|
||||
|
||||
@ -964,7 +964,7 @@ pub mod raw {
|
||||
use collections::Collection;
|
||||
use ptr::RawPtr;
|
||||
use raw::Slice;
|
||||
use slice::{ImmutableVector};
|
||||
use slice::{ImmutableSlice};
|
||||
use str::{is_utf8, StrSlice};
|
||||
|
||||
/// Converts a slice of bytes to a string slice without checking
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
use std::cmp;
|
||||
use std::mem;
|
||||
use std::slice::MutableVector;
|
||||
use std::slice::MutableSlice;
|
||||
use compile::{
|
||||
Program,
|
||||
Match, OneChar, CharClass, Any, EmptyBegin, EmptyEnd, EmptyWordBoundary,
|
||||
|
@ -112,7 +112,7 @@ mod test {
|
||||
use core::iter::Iterator;
|
||||
use core::collections::Collection;
|
||||
use core::str::StrSlice;
|
||||
use core::slice::{MutableVector, ImmutableVector};
|
||||
use core::slice::{MutableSlice, ImmutableSlice};
|
||||
|
||||
use super::{memcmp, memset, memcpy, memmove};
|
||||
|
||||
|
@ -19,7 +19,7 @@ use fmt;
|
||||
use iter::Iterator;
|
||||
use mem;
|
||||
use option::{Option, Some, None};
|
||||
use slice::{ImmutableVector, MutableVector, Vector};
|
||||
use slice::{ImmutableSlice, MutableSlice, Vector};
|
||||
use str::{Str, StrSlice};
|
||||
use str;
|
||||
use string::String;
|
||||
|
@ -2743,7 +2743,7 @@ mod test_set {
|
||||
use prelude::*;
|
||||
|
||||
use super::HashSet;
|
||||
use slice::ImmutableEqVector;
|
||||
use slice::ImmutableEqSlice;
|
||||
use collections::Collection;
|
||||
|
||||
#[test]
|
||||
|
@ -29,7 +29,7 @@ use option::*;
|
||||
use os;
|
||||
use path::{Path,GenericPath};
|
||||
use result::*;
|
||||
use slice::{Vector,ImmutableVector};
|
||||
use slice::{Vector,ImmutableSlice};
|
||||
use str;
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
|
@ -19,7 +19,7 @@ use iter::ExactSize;
|
||||
use ops::Drop;
|
||||
use option::{Some, None, Option};
|
||||
use result::{Ok, Err};
|
||||
use slice::{ImmutableVector, MutableVector};
|
||||
use slice::{ImmutableSlice, MutableSlice};
|
||||
use slice;
|
||||
use vec::Vec;
|
||||
|
||||
|
@ -15,7 +15,7 @@ use comm::{Sender, Receiver};
|
||||
use io;
|
||||
use option::{None, Option, Some};
|
||||
use result::{Ok, Err};
|
||||
use slice::{bytes, MutableVector, ImmutableVector};
|
||||
use slice::{bytes, MutableSlice, ImmutableSlice};
|
||||
use str::StrSlice;
|
||||
use super::{Reader, Writer, IoResult};
|
||||
use vec::Vec;
|
||||
|
@ -21,7 +21,7 @@ use option::{Option, Some, None};
|
||||
use result::{Ok, Err};
|
||||
use io;
|
||||
use io::{IoError, IoResult, Reader};
|
||||
use slice::{ImmutableVector, Vector};
|
||||
use slice::{ImmutableSlice, Vector};
|
||||
use ptr::RawPtr;
|
||||
|
||||
/// An iterator that reads a single byte on each iteration,
|
||||
@ -153,7 +153,7 @@ pub fn u64_to_be_bytes<T>(n: u64, size: uint, f: |v: &[u8]| -> T) -> T {
|
||||
pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 {
|
||||
use ptr::{copy_nonoverlapping_memory};
|
||||
use mem::from_be64;
|
||||
use slice::MutableVector;
|
||||
use slice::MutableSlice;
|
||||
|
||||
assert!(size <= 8u);
|
||||
|
||||
|
@ -70,7 +70,7 @@ use path;
|
||||
use result::{Err, Ok};
|
||||
use rt::rtio::LocalIo;
|
||||
use rt::rtio;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
use vec::Vec;
|
||||
|
||||
|
@ -19,7 +19,7 @@ use result::{Err, Ok};
|
||||
use io;
|
||||
use io::{Reader, Writer, Seek, Buffer, IoError, SeekStyle, IoResult};
|
||||
use slice;
|
||||
use slice::{Vector, ImmutableVector, MutableVector};
|
||||
use slice::{Vector, ImmutableSlice, MutableSlice};
|
||||
use vec::Vec;
|
||||
|
||||
static BUF_CAPACITY: uint = 128;
|
||||
|
@ -235,7 +235,7 @@ use os;
|
||||
use boxed::Box;
|
||||
use result::{Ok, Err, Result};
|
||||
use rt::rtio;
|
||||
use slice::{Vector, MutableVector, ImmutableVector};
|
||||
use slice::{Vector, MutableSlice, ImmutableSlice};
|
||||
use str::{Str, StrSlice};
|
||||
use str;
|
||||
use string::String;
|
||||
|
@ -21,7 +21,7 @@ use from_str::FromStr;
|
||||
use iter::Iterator;
|
||||
use option::{Option, None, Some};
|
||||
use str::StrSlice;
|
||||
use slice::{MutableCloneableVector, ImmutableVector, MutableVector};
|
||||
use slice::{MutableCloneableSlice, ImmutableSlice, MutableSlice};
|
||||
|
||||
pub type Port = u16;
|
||||
|
||||
|
@ -21,7 +21,7 @@ use clone::Clone;
|
||||
use collections::MutableSeq;
|
||||
use io::IoResult;
|
||||
use iter::Iterator;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use result::{Ok,Err};
|
||||
use io::net::addrinfo::get_host_addresses;
|
||||
use io::net::ip::SocketAddr;
|
||||
|
@ -30,7 +30,7 @@ use option::{Some, None};
|
||||
use boxed::Box;
|
||||
use result::{Ok, Err};
|
||||
use rt::rtio::{IoFactory, LocalIo, RtioSignal, Callback};
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use vec::Vec;
|
||||
|
||||
/// Signals that can be sent and received
|
||||
|
@ -41,7 +41,7 @@ use rt;
|
||||
use rt::local::Local;
|
||||
use rt::task::Task;
|
||||
use rt::rtio::{DontClose, IoFactory, LocalIo, RtioFileStream, RtioTTY};
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use str::StrSlice;
|
||||
use uint;
|
||||
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::i16::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::i32::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::i64::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::i8::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::int::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -20,7 +20,7 @@ use num::{Float, FPNaN, FPInfinite, ToPrimitive};
|
||||
use num;
|
||||
use ops::{Add, Sub, Mul, Div, Rem, Neg};
|
||||
use option::{None, Option, Some};
|
||||
use slice::{ImmutableVector, MutableVector};
|
||||
use slice::{ImmutableSlice, MutableSlice};
|
||||
use std::cmp::{PartialOrd, PartialEq};
|
||||
use str::StrSlice;
|
||||
use string::String;
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::u16::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::u32::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::u64::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::u8::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -17,7 +17,7 @@ use from_str::FromStr;
|
||||
use num::{ToStrRadix, FromStrRadix};
|
||||
use num::strconv;
|
||||
use option::Option;
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use string::String;
|
||||
|
||||
pub use core::uint::{BITS, BYTES, MIN, MAX};
|
||||
|
@ -45,7 +45,7 @@ use path::{Path, GenericPath, BytesContainer};
|
||||
use ptr::RawPtr;
|
||||
use ptr;
|
||||
use result::{Err, Ok, Result};
|
||||
use slice::{Vector, ImmutableVector, MutableVector, ImmutableEqVector};
|
||||
use slice::{Vector, ImmutableSlice, MutableSlice, ImmutableEqSlice};
|
||||
use str::{Str, StrSlice, StrAllocating};
|
||||
use string::String;
|
||||
use sync::atomic::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
|
||||
@ -145,7 +145,7 @@ pub mod win32 {
|
||||
use option::{None, Option};
|
||||
use option;
|
||||
use os::TMPBUF_SZ;
|
||||
use slice::{MutableVector, ImmutableVector};
|
||||
use slice::{MutableSlice, ImmutableSlice};
|
||||
use string::String;
|
||||
use str::StrSlice;
|
||||
use vec::Vec;
|
||||
|
@ -75,7 +75,7 @@ use str;
|
||||
use str::{MaybeOwned, Str, StrSlice};
|
||||
use string::String;
|
||||
use slice::Vector;
|
||||
use slice::{ImmutableEqVector, ImmutableVector};
|
||||
use slice::{ImmutableEqSlice, ImmutableSlice};
|
||||
use vec::Vec;
|
||||
|
||||
/// Typedef for POSIX file paths.
|
||||
|
@ -22,7 +22,7 @@ use option::{Option, None, Some};
|
||||
use str::Str;
|
||||
use str;
|
||||
use slice::{CloneableVector, Splits, Vector, VectorVector,
|
||||
ImmutableEqVector, ImmutableVector};
|
||||
ImmutableEqSlice, ImmutableSlice};
|
||||
use vec::Vec;
|
||||
|
||||
use super::{BytesContainer, GenericPath, GenericPathUnsafe};
|
||||
|
@ -23,7 +23,7 @@ use io::Writer;
|
||||
use iter::{AdditiveIterator, DoubleEndedIterator, Extendable, Iterator, Map};
|
||||
use mem;
|
||||
use option::{Option, Some, None};
|
||||
use slice::{Vector, ImmutableVector};
|
||||
use slice::{Vector, ImmutableSlice};
|
||||
use str::{CharSplits, Str, StrAllocating, StrVector, StrSlice};
|
||||
use string::String;
|
||||
use unicode::char::UnicodeChar;
|
||||
|
@ -83,11 +83,11 @@
|
||||
#[doc(no_inline)] pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
|
||||
#[doc(no_inline)] pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};
|
||||
#[doc(no_inline)] pub use slice::{CloneableVector, ImmutableCloneableVector};
|
||||
#[doc(no_inline)] pub use slice::{MutableCloneableVector, MutableOrdVector};
|
||||
#[doc(no_inline)] pub use slice::{ImmutableVector, MutableVector};
|
||||
#[doc(no_inline)] pub use slice::{ImmutableEqVector, ImmutableOrdVector};
|
||||
#[doc(no_inline)] pub use slice::{MutableCloneableSlice, MutableOrdSlice};
|
||||
#[doc(no_inline)] pub use slice::{ImmutableSlice, MutableSlice};
|
||||
#[doc(no_inline)] pub use slice::{ImmutableEqSlice, ImmutableOrdSlice};
|
||||
#[doc(no_inline)] pub use slice::{Vector, VectorVector};
|
||||
#[doc(no_inline)] pub use slice::MutableVectorAllocating;
|
||||
#[doc(no_inline)] pub use slice::MutableSliceAllocating;
|
||||
#[doc(no_inline)] pub use string::String;
|
||||
#[doc(no_inline)] pub use vec::Vec;
|
||||
|
||||
|
@ -70,7 +70,7 @@ mod imp {
|
||||
use rand::Rng;
|
||||
use result::{Ok};
|
||||
use self::libc::{c_int, size_t};
|
||||
use slice::MutableVector;
|
||||
use slice::MutableSlice;
|
||||
|
||||
/// A random number generator that retrieves randomness straight from
|
||||
/// the operating system. Platform sources:
|
||||
@ -138,7 +138,7 @@ mod imp {
|
||||
use rt::stack;
|
||||
use self::libc::{DWORD, BYTE, LPCSTR, BOOL};
|
||||
use self::libc::types::os::arch::extra::{LONG_PTR};
|
||||
use slice::MutableVector;
|
||||
use slice::MutableSlice;
|
||||
|
||||
type HCRYPTPROV = LONG_PTR;
|
||||
|
||||
|
@ -258,7 +258,7 @@ mod imp {
|
||||
pub fn write(w: &mut Writer) -> IoResult<()> {
|
||||
use iter::{Iterator, range};
|
||||
use result;
|
||||
use slice::{MutableVector};
|
||||
use slice::{MutableSlice};
|
||||
|
||||
extern {
|
||||
fn backtrace(buf: *mut *mut libc::c_void,
|
||||
@ -398,7 +398,7 @@ mod imp {
|
||||
use path::GenericPath;
|
||||
use ptr::RawPtr;
|
||||
use ptr;
|
||||
use slice::{ImmutableVector, MutableVector};
|
||||
use slice::{ImmutableSlice, MutableSlice};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// libbacktrace.h API
|
||||
@ -670,7 +670,7 @@ mod imp {
|
||||
use path::Path;
|
||||
use result::{Ok, Err};
|
||||
use rt::mutex::{StaticNativeMutex, NATIVE_MUTEX_INIT};
|
||||
use slice::ImmutableVector;
|
||||
use slice::ImmutableSlice;
|
||||
use str::StrSlice;
|
||||
use dynamic_lib::DynamicLibrary;
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
use core::cmp::{Equal, Less, Greater};
|
||||
use core::option::{Option, Some, None};
|
||||
use core::slice::ImmutableVector;
|
||||
use core::slice::ImmutableSlice;
|
||||
use tables::normalization::{canonical_table, compatibility_table, composition_table};
|
||||
|
||||
fn bsearch_table<T>(c: char, r: &'static [(char, &'static [T])]) -> Option<&'static [T]> {
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool {
|
||||
use core::cmp::{Equal, Less, Greater};
|
||||
use core::slice::ImmutableVector;
|
||||
use core::slice::ImmutableSlice;
|
||||
use core::option::None;
|
||||
r.bsearch(|&(lo,hi)| {
|
||||
if lo <= c && c <= hi { Equal }
|
||||
@ -6230,7 +6230,7 @@ pub mod normalization {
|
||||
fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 {
|
||||
use core::option::{Some, None};
|
||||
use core::cmp::{Equal, Less, Greater};
|
||||
use core::slice::ImmutableVector;
|
||||
use core::slice::ImmutableSlice;
|
||||
match r.bsearch(|&(lo, hi, _)| {
|
||||
if lo <= c && c <= hi { Equal }
|
||||
else if hi < c { Less }
|
||||
@ -6354,7 +6354,7 @@ pub mod normalization {
|
||||
|
||||
pub mod conversions {
|
||||
use core::cmp::{Equal, Less, Greater};
|
||||
use core::slice::ImmutableVector;
|
||||
use core::slice::ImmutableSlice;
|
||||
use core::tuple::Tuple2;
|
||||
use core::option::{Option, Some, None};
|
||||
|
||||
@ -6915,7 +6915,7 @@ pub mod conversions {
|
||||
|
||||
pub mod charwidth {
|
||||
use core::option::{Option, Some, None};
|
||||
use core::slice::ImmutableVector;
|
||||
use core::slice::ImmutableSlice;
|
||||
|
||||
fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 {
|
||||
use core::cmp::{Equal, Less, Greater};
|
||||
@ -7113,7 +7113,7 @@ pub mod charwidth {
|
||||
|
||||
pub mod grapheme {
|
||||
use core::option::{Some, None};
|
||||
use core::slice::ImmutableVector;
|
||||
use core::slice::ImmutableSlice;
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
#[deriving(Clone)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user