@@ -209,12 +209,12 @@ pub pure fn build_sized_opt<A>(size: Option<uint>,
209209}
210210
211211/// Produces a mut vector from an immutable vector.
212- pub pure fn to_mut < T > ( v : ~[ T ] ) -> ~[ mut T ] {
212+ pub pure fn cast_to_mut < T > ( v : ~[ T ] ) -> ~[ mut T ] {
213213 unsafe { :: cast:: transmute ( v) }
214214}
215215
216216/// Produces an immutable vector from a mut vector.
217- pub pure fn from_mut < T > ( v : ~[ mut T ] ) -> ~[ T ] {
217+ pub pure fn cast_from_mut < T > ( v : ~[ mut T ] ) -> ~[ T ] {
218218 unsafe { :: cast:: transmute ( v) }
219219}
220220
@@ -552,7 +552,7 @@ pub fn consume<T>(v: ~[T], f: fn(uint, v: T)) unsafe {
552552}
553553
554554pub fn consume_mut < T > ( v : ~[ mut T ] , f : fn ( uint , v : T ) ) {
555- consume ( vec:: from_mut ( v) , f)
555+ consume ( vec:: cast_from_mut ( v) , f)
556556}
557557
558558/// Remove the last element from a vector and return it
@@ -718,7 +718,7 @@ pub pure fn append_one<T>(lhs: ~[T], x: T) -> ~[T] {
718718
719719#[ inline( always) ]
720720pub pure fn append_mut < T : Copy > ( lhs : ~[ mut T ] , rhs : & [ const T ] ) -> ~[ mut T ] {
721- to_mut ( append ( from_mut ( lhs) , rhs) )
721+ cast_to_mut ( append ( cast_from_mut ( lhs) , rhs) )
722722}
723723
724724/**
@@ -3271,22 +3271,22 @@ mod tests {
32713271 }
32723272
32733273 #[ test]
3274- fn to_mut_no_copy ( ) {
3274+ fn cast_to_mut_no_copy ( ) {
32753275 unsafe {
32763276 let x = ~[ 1 , 2 , 3 ] ;
32773277 let addr = raw:: to_ptr ( x) ;
3278- let x_mut = to_mut ( x) ;
3278+ let x_mut = cast_to_mut ( x) ;
32793279 let addr_mut = raw:: to_ptr ( x_mut) ;
32803280 assert addr == addr_mut;
32813281 }
32823282 }
32833283
32843284 #[ test]
3285- fn from_mut_no_copy ( ) {
3285+ fn cast_from_mut_no_copy ( ) {
32863286 unsafe {
32873287 let x = ~[ mut 1 , 2 , 3 ] ;
32883288 let addr = raw:: to_ptr ( x) ;
3289- let x_imm = from_mut ( x) ;
3289+ let x_imm = cast_from_mut ( x) ;
32903290 let addr_imm = raw:: to_ptr ( x_imm) ;
32913291 assert addr == addr_imm;
32923292 }
0 commit comments