File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: a692e9b1234ff6573b0cfbc39394d9222eb38f81
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: b5dd3f05fe95168b5569d0f519636149479eb6ac
5
- refs/heads/try: ff04aa8e385f343f66c5bed6a34d1ebf6c971e4d
5
+ refs/heads/try: fc2815a5cc703523c9a9aa2f2982e667e58a0402
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
Original file line number Diff line number Diff line change @@ -419,7 +419,6 @@ pub fn self_exe_name() -> Option<Path> {
419
419
unsafe {
420
420
use libc:: funcs:: bsd44:: * ;
421
421
use libc:: consts:: os:: extra:: * ;
422
- use slice;
423
422
let mib = ~[ CTL_KERN as c_int ,
424
423
KERN_PROC as c_int ,
425
424
KERN_PROC_PATHNAME as c_int , -1 as c_int ] ;
@@ -429,14 +428,14 @@ pub fn self_exe_name() -> Option<Path> {
429
428
0 u as libc:: size_t ) ;
430
429
if err != 0 { return None ; }
431
430
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 ) ;
433
432
let err = sysctl ( mib. as_ptr ( ) , mib. len ( ) as :: libc:: c_uint ,
434
433
v. as_mut_ptr ( ) as * mut c_void , & mut sz, ptr:: null ( ) ,
435
434
0 u as libc:: size_t ) ;
436
435
if err != 0 { return None ; }
437
436
if sz == 0 { return None ; }
438
437
v. set_len ( sz as uint - 1 ) ; // chop off trailing NUL
439
- Some ( v)
438
+ Some ( v. move_iter ( ) . collect ( ) )
440
439
}
441
440
}
442
441
You can’t perform that action at this time.
0 commit comments