Skip to content

Commit 9c11ea2

Browse files
committed
---
yaml --- r: 112195 b: refs/heads/try c: fc2815a h: refs/heads/master i: 112193: adbad5e 112191: 724178f v: v3
1 parent 775fbf8 commit 9c11ea2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: a692e9b1234ff6573b0cfbc39394d9222eb38f81
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b5dd3f05fe95168b5569d0f519636149479eb6ac
5-
refs/heads/try: ff04aa8e385f343f66c5bed6a34d1ebf6c971e4d
5+
refs/heads/try: fc2815a5cc703523c9a9aa2f2982e667e58a0402
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libstd/os.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ pub fn self_exe_name() -> Option<Path> {
419419
unsafe {
420420
use libc::funcs::bsd44::*;
421421
use libc::consts::os::extra::*;
422-
use slice;
423422
let mib = ~[CTL_KERN as c_int,
424423
KERN_PROC as c_int,
425424
KERN_PROC_PATHNAME as c_int, -1 as c_int];
@@ -429,14 +428,14 @@ pub fn self_exe_name() -> Option<Path> {
429428
0u as libc::size_t);
430429
if err != 0 { return None; }
431430
if sz == 0 { return None; }
432-
let mut v: ~[u8] = slice::with_capacity(sz as uint);
431+
let mut v: Vec<u8> = Vec::with_capacity(sz as uint);
433432
let err = sysctl(mib.as_ptr(), mib.len() as ::libc::c_uint,
434433
v.as_mut_ptr() as *mut c_void, &mut sz, ptr::null(),
435434
0u as libc::size_t);
436435
if err != 0 { return None; }
437436
if sz == 0 { return None; }
438437
v.set_len(sz as uint - 1); // chop off trailing NUL
439-
Some(v)
438+
Some(v.move_iter().collect())
440439
}
441440
}
442441

0 commit comments

Comments
 (0)