File tree Expand file tree Collapse file tree 5 files changed +9
-10
lines changed Expand file tree Collapse file tree 5 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ pub fn Bitv (nbits: uint, init: bool) -> Bitv {
233
233
let nelems = nbits/uint_bits +
234
234
if nbits % uint_bits == 0 { 0 } else { 1 } ;
235
235
let elem = if init { !0 } else { 0 } ;
236
- let s = cast_to_mut ( from_elem ( nelems, elem) ) ;
236
+ let s = from_elem ( nelems, elem) ;
237
237
Big ( ~BigBitv ( move s) )
238
238
} ;
239
239
Bitv { rep : move rep, nbits : nbits}
@@ -518,7 +518,7 @@ impl Bitv: Clone {
518
518
Bitv { nbits : self . nbits , rep : Small ( ~SmallBitv { bits : b. bits } ) }
519
519
}
520
520
Big ( ref b) => {
521
- let st = cast_to_mut ( from_elem ( self . nbits / uint_bits + 1 , 0 ) ) ;
521
+ let mut st = from_elem ( self . nbits / uint_bits + 1 , 0 ) ;
522
522
let len = st. len ( ) ;
523
523
for uint:: range( 0 , len) |i| { st[ i] = b. storage [ i] ; } ;
524
524
Bitv { nbits : self . nbits , rep : Big ( ~BigBitv { storage : move st} ) }
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ pub mod chained {
209
209
fn rehash ( ) {
210
210
let n_old_chains = self . chains . len ( ) ;
211
211
let n_new_chains: uint = uint:: next_power_of_two ( n_old_chains+1 u) ;
212
- let new_chains = chains ( n_new_chains) ;
212
+ let mut new_chains = chains ( n_new_chains) ;
213
213
for self . each_entry |entry| {
214
214
let idx = entry. hash % n_new_chains;
215
215
entry. next = new_chains[ idx] ;
@@ -459,7 +459,7 @@ pub mod chained {
459
459
}
460
460
461
461
fn chains < K , V > ( nchains : uint ) -> ~[ Option < @Entry < K , V > > ] {
462
- vec:: cast_to_mut ( vec :: from_elem ( nchains, None ) )
462
+ vec:: from_elem ( nchains, None )
463
463
}
464
464
465
465
pub fn mk < K : Eq IterBytes Hash , V : Copy > ( ) -> T < K , V > {
Original file line number Diff line number Diff line change @@ -1168,8 +1168,7 @@ pub mod node {
1168
1168
}
1169
1169
1170
1170
pub fn start ( node : @Node ) -> T {
1171
- let stack = vec:: cast_to_mut (
1172
- vec:: from_elem ( height ( node) +1 u, node) ) ;
1171
+ let stack = vec:: from_elem ( height ( node) +1 u, node) ;
1173
1172
T {
1174
1173
stack : stack,
1175
1174
stackpos : 0 ,
Original file line number Diff line number Diff line change @@ -67,13 +67,13 @@ const k3: u32 = 0xCA62C1D6u32;
67
67
/// Construct a `sha` object
68
68
pub fn sha1 ( ) -> Sha1 {
69
69
type Sha1State =
70
- { h : ~[ u32 ] ,
70
+ { h : ~[ mut u32] ,
71
71
mut len_low : u32 ,
72
72
mut len_high : u32 ,
73
- mut msg_block : ~[ u8 ] ,
73
+ msg_block : ~[ mut u8] ,
74
74
mut msg_block_idx : uint ,
75
75
mut computed : bool ,
76
- work_buf : @~[ u32 ] } ;
76
+ work_buf : @~[ mut u32] } ;
77
77
78
78
fn add_input ( st : & Sha1State , msg : & [ const u8 ] ) {
79
79
assert ( !st. computed ) ;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ fn new_sem_and_signal(count: int, num_condvars: uint)
97
97
for num_condvars. times {
98
98
queues. push( new_waitqueue( ) ) ;
99
99
}
100
- new_sem ( count, vec :: cast_to_mut ( move queues) )
100
+ new_sem ( count, queues)
101
101
}
102
102
103
103
#[ doc( hidden) ]
You can’t perform that action at this time.
0 commit comments