diff options
| author | bors <bors@rust-lang.org> | 2013-12-18 17:11:42 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-12-18 17:11:42 -0800 |
| commit | 3c2c13bae4783c808f6640286d41cba6d9394dd9 (patch) | |
| tree | d3ae5a40f19d374e7c30aae661b7083172769ef6 /src/libstd/rt | |
| parent | b6933f8d8b86f78ac7b5f70f0781d794144763a0 (diff) | |
| parent | b906a8b256e8e7a289bb7b0e4382f30c4bd0f431 (diff) | |
| download | rust-3c2c13bae4783c808f6640286d41cba6d9394dd9.tar.gz rust-3c2c13bae4783c808f6640286d41cba6d9394dd9.zip | |
auto merge of #11029 : huonw/rust/rm-vec-as-buf, r=cmr
For `str.as_mut_buf`, un-closure-ification is achieved by outright removal (see commit message). The others are replaced by `.as_ptr`, `.as_mut_ptr` and `.len`
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/sched.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs index ac3aeb5a4bb..cd21cdeb711 100644 --- a/src/libstd/rt/sched.rs +++ b/src/libstd/rt/sched.rs @@ -914,13 +914,11 @@ fn new_sched_rng() -> XorShiftRng { let mut seeds = [0u32, .. 4]; let size = mem::size_of_val(&seeds); loop { - let nbytes = seeds.as_mut_buf(|buf, _| { - unsafe { - libc::read(fd, - buf as *mut libc::c_void, - size as libc::size_t) - } - }); + let nbytes = unsafe { + libc::read(fd, + seeds.as_mut_ptr() as *mut libc::c_void, + size as libc::size_t) + }; rtassert!(nbytes as uint == size); if !seeds.iter().all(|x| *x == 0) { |
