Skip to content

Commit

Permalink
std: Collapse SlicePrelude traits
Browse files Browse the repository at this point in the history
This commit collapses the various prelude traits for slices into just one trait:

* SlicePrelude/SliceAllocPrelude => SliceExt
* CloneSlicePrelude/CloneSliceAllocPrelude => CloneSliceExt
* OrdSlicePrelude/OrdSliceAllocPrelude => OrdSliceExt
* PartialEqSlicePrelude => PartialEqSliceExt
  • Loading branch information
alexcrichton committed Dec 15, 2014
1 parent 126db54 commit 7741516
Show file tree
Hide file tree
Showing 42 changed files with 782 additions and 539 deletions.
10 changes: 5 additions & 5 deletions src/etc/unicode.py
Expand Up @@ -289,7 +289,7 @@ def emit_bsearch_range_table(f):
f.write("""
fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool {
use core::cmp::Ordering::{Equal, Less, Greater};
use core::slice::SlicePrelude;
use core::slice::SliceExt;
r.binary_search(|&(lo,hi)| {
if lo <= c && c <= hi { Equal }
else if hi < c { Less }
Expand Down Expand Up @@ -347,7 +347,7 @@ def emit_conversions_module(f, lowerupper, upperlower):
f.write("pub mod conversions {")
f.write("""
use core::cmp::Ordering::{Equal, Less, Greater};
use core::slice::SlicePrelude;
use core::slice::SliceExt;
use core::option::Option;
use core::option::Option::{Some, None};
use core::slice;
Expand Down Expand Up @@ -386,8 +386,8 @@ def emit_conversions_module(f, lowerupper, upperlower):

def emit_grapheme_module(f, grapheme_table, grapheme_cats):
f.write("""pub mod grapheme {
use core::slice::SlicePrelude;
use core::kinds::Copy;
use core::slice::SliceExt;
pub use self::GraphemeCat::*;
use core::slice;
Expand Down Expand Up @@ -431,7 +431,7 @@ def emit_charwidth_module(f, width_table):
f.write("pub mod charwidth {\n")
f.write(" use core::option::Option;\n")
f.write(" use core::option::Option::{Some, None};\n")
f.write(" use core::slice::SlicePrelude;\n")
f.write(" use core::slice::SliceExt;\n")
f.write(" use core::slice;\n")
f.write("""
fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 {
Expand Down Expand Up @@ -531,7 +531,7 @@ def comp_pfun(char):
f.write("""
fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 {
use core::cmp::Ordering::{Equal, Less, Greater};
use core::slice::SlicePrelude;
use core::slice::SliceExt;
use core::slice;
match r.binary_search(|&(lo, hi, _)| {
if lo <= c && c <= hi { Equal }
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/hash/mod.rs
Expand Up @@ -297,7 +297,7 @@ mod tests {
use core::kinds::Sized;
use std::mem;

use slice::SlicePrelude;
use slice::SliceExt;
use super::{Hash, Hasher, Writer};

struct MyWriterHasher;
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/hash/sip.rs
Expand Up @@ -276,7 +276,7 @@ mod tests {

use str::Str;
use string::String;
use slice::{AsSlice, SlicePrelude};
use slice::{AsSlice, SliceExt};
use vec::Vec;

use super::super::{Hash, Writer};
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/lib.rs
Expand Up @@ -24,7 +24,7 @@
#![allow(unknown_features)]
#![feature(macro_rules, default_type_params, phase, globs)]
#![feature(unsafe_destructor, import_shadowing, slicing_syntax)]
#![feature(tuple_indexing, unboxed_closures)]
#![feature(unboxed_closures)]
#![no_std]

#[phase(plugin, link)] extern crate core;
Expand Down

11 comments on commit 7741516

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at alexcrichton@7741516

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging alexcrichton/rust/slice-one-trait = 7741516 into auto

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexcrichton/rust/slice-one-trait = 7741516 merged ok, testing candidate = 72b0fc4

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 15, 2014

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from brson
at alexcrichton@7741516

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging alexcrichton/rust/slice-one-trait = 7741516 into auto

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status: {"merge_sha": "b497f050081886803682adc081ddb1e8c4a59a57"}

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexcrichton/rust/slice-one-trait = 7741516 merged ok, testing candidate = b497f05

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = b497f05

@bors
Copy link
Contributor

@bors bors commented on 7741516 Dec 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = b497f05

Please sign in to comment.