Minor cleanup, implement Debug, Display for CBox
This commit is contained in:
parent
f0b3d5166e
commit
de9bc974a6
5 changed files with 47 additions and 16 deletions
|
@ -15,10 +15,11 @@ pub extern "C" fn main(_nargs: libc::c_int, _args: *const *const libc::c_char) -
|
|||
let z = unsafe {
|
||||
libc::boxed::CBox::slice_from_raw_parts(y, l)
|
||||
};
|
||||
//let y = unsafe { c::string::CBox::from_raw(x) };
|
||||
let foo = cstr!("Foo!\n");
|
||||
stdout.puts(foo);
|
||||
let _ = writeln!(stdout, "Foo: {} {} {}", z[0], z[1], z[2]);
|
||||
let b = libc::boxed::CBox::new(42);
|
||||
let _ = writeln!(stdout, "Bar: {}", b);
|
||||
0
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue