Skip to content

Commit 7b6e7eb

Browse files
committed
auto merge of #13613 : alexcrichton/rust/fix-freebsd-compile, r=brson
Ah, the wonders of not being gated on FreeBSD...
2 parents 3757f01 + 79de910 commit 7b6e7eb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/libstd/os.rs

+2-3
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)