about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-03-22 17:58:50 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-03-26 21:29:33 -0700
commit0d52b22e7bd554464144e0a037285f62ddbd9eb2 (patch)
tree310d55925f7b6d1f4df6f20bcff378dead8470e9 /src/libstd
parent5df1aaab9835795bd0ef22d795d57039b703fb21 (diff)
libcore: Change `[const T]` to `const [T]` everywhere
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/arena.rs2
-rw-r--r--src/libstd/net_tcp.rs2
-rw-r--r--src/libstd/sha1.rs6
-rw-r--r--src/libstd/sort.rs29
4 files changed, 23 insertions, 16 deletions
diff --git a/src/libstd/arena.rs b/src/libstd/arena.rs
index a26132d92ca..683e4a62975 100644
--- a/src/libstd/arena.rs
+++ b/src/libstd/arena.rs
@@ -101,7 +101,7 @@ impl Drop for Arena {
 }
 
 fn chunk(size: uint, is_pod: bool) -> Chunk {
-    let mut v: @[const u8] = @[];
+    let mut v: @[u8] = @[];
     unsafe { at_vec::raw::reserve(&mut v, size); }
     Chunk {
         data: unsafe { cast::transmute(v) },
diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs
index c49f65d0f99..c1743c98c9b 100644
--- a/src/libstd/net_tcp.rs
+++ b/src/libstd/net_tcp.rs
@@ -972,7 +972,7 @@ impl io::Reader for TcpSocketBuf {
 
 /// Implementation of `io::Reader` trait for a buffered `net::tcp::TcpSocket`
 impl io::Writer for TcpSocketBuf {
-    pub fn write(&self, data: &[const u8]) {
+    pub fn write(&self, data: &const [u8]) {
         unsafe {
             let socket_data_ptr =
                 ptr::addr_of(&(*((*(self.data)).sock).socket_data));
diff --git a/src/libstd/sha1.rs b/src/libstd/sha1.rs
index 64399defd54..b603e2eb1cc 100644
--- a/src/libstd/sha1.rs
+++ b/src/libstd/sha1.rs
@@ -35,7 +35,7 @@ use core::vec;
 /// The SHA-1 interface
 trait Sha1 {
     /// Provide message input as bytes
-    fn input(&mut self, &[const u8]);
+    fn input(&mut self, &const [u8]);
     /// Provide message input as string
     fn input_str(&mut self, &str);
     /**
@@ -73,7 +73,7 @@ pub fn sha1() -> @Sha1 {
           computed: bool,
           work_buf: @mut ~[u32]};
 
-    fn add_input(st: &mut Sha1State, msg: &[const u8]) {
+    fn add_input(st: &mut Sha1State, msg: &const [u8]) {
         fail_unless!((!st.computed));
         for vec::each_const(msg) |element| {
             st.msg_block[st.msg_block_idx] = *element;
@@ -241,7 +241,7 @@ pub fn sha1() -> @Sha1 {
             self.h[4] = 0xC3D2E1F0u32;
             self.computed = false;
         }
-        fn input(&mut self, msg: &[const u8]) { add_input(self, msg); }
+        fn input(&mut self, msg: &const [u8]) { add_input(self, msg); }
         fn input_str(&mut self, msg: &str) {
             let bs = str::to_bytes(msg);
             add_input(self, bs);
diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs
index 8a239e8b6d8..2d83c4bd9d0 100644
--- a/src/libstd/sort.rs
+++ b/src/libstd/sort.rs
@@ -24,12 +24,12 @@ type Le<T> = &'self fn(v1: &T, v2: &T) -> bool;
  * Has worst case O(n log n) performance, best case O(n), but
  * is not space efficient. This is a stable sort.
  */
-pub fn merge_sort<T:Copy>(v: &[const T], le: Le<T>) -> ~[T] {
+pub fn merge_sort<T:Copy>(v: &const [T], le: Le<T>) -> ~[T] {
     type Slice = (uint, uint);
 
     unsafe {return merge_sort_(v, (0u, len(v)), le);}
 
-    fn merge_sort_<T:Copy>(v: &[const T], slice: Slice, le: Le<T>)
+    fn merge_sort_<T:Copy>(v: &const [T], slice: Slice, le: Le<T>)
         -> ~[T] {
         let begin = slice.first();
         let end = slice.second();
@@ -290,8 +290,10 @@ fn count_run_ascending<T:Copy + Ord>(array: &mut [T]) -> uint {
     return run;
 }
 
-fn gallop_left<T:Copy + Ord>(key: &const T, array: &[const T],
-                            hint: uint) -> uint {
+fn gallop_left<T:Copy + Ord>(key: &const T,
+                             array: &const [T],
+                             hint: uint)
+                          -> uint {
     let size = array.len();
     fail_unless!(size != 0 && hint < size);
 
@@ -339,8 +341,10 @@ fn gallop_left<T:Copy + Ord>(key: &const T, array: &[const T],
     return ofs;
 }
 
-fn gallop_right<T:Copy + Ord>(key: &const T, array: &[const T],
-                            hint: uint) -> uint {
+fn gallop_right<T:Copy + Ord>(key: &const T,
+                              array: &const [T],
+                              hint: uint)
+                           -> uint {
     let size = array.len();
     fail_unless!(size != 0 && hint < size);
 
@@ -709,8 +713,11 @@ impl<T:Copy + Ord> MergeState<T> {
 }
 
 #[inline(always)]
-fn copy_vec<T:Copy>(dest: &mut [T], s1: uint,
-                    from: &[const T], s2: uint, len: uint) {
+fn copy_vec<T:Copy>(dest: &mut [T],
+                    s1: uint,
+                    from: &const [T],
+                    s2: uint,
+                    len: uint) {
     fail_unless!(s1+len <= dest.len() && s2+len <= from.len());
 
     let mut slice = ~[];
@@ -1022,7 +1029,7 @@ mod big_tests {
         tabulate_managed(low, high);
     }
 
-    fn multiplyVec<T:Copy>(arr: &[const T], num: uint) -> ~[T] {
+    fn multiplyVec<T:Copy>(arr: &const [T], num: uint) -> ~[T] {
         let size = arr.len();
         let res = do vec::from_fn(num) |i| {
             arr[i % size]
@@ -1038,7 +1045,7 @@ mod big_tests {
     }
 
     fn tabulate_unique(lo: uint, hi: uint) {
-        fn isSorted<T:Ord>(arr: &[const T]) {
+        fn isSorted<T:Ord>(arr: &const [T]) {
             for uint::range(0, arr.len()-1) |i| {
                 if arr[i] > arr[i+1] {
                     fail!(~"Array not sorted");
@@ -1110,7 +1117,7 @@ mod big_tests {
     }
 
     fn tabulate_managed(lo: uint, hi: uint) {
-        fn isSorted<T:Ord>(arr: &[const @T]) {
+        fn isSorted<T:Ord>(arr: &const [@T]) {
             for uint::range(0, arr.len()-1) |i| {
                 if arr[i] > arr[i+1] {
                     fail!(~"Array not sorted");