fix tutorial lint warnings
This commit is contained in:
parent
042618da7b
commit
ed93cc1987
1 changed files with 1 additions and 2 deletions
|
@ -153,7 +153,6 @@ use std::cast;
|
||||||
use std::libc::{c_void, size_t, malloc, free};
|
use std::libc::{c_void, size_t, malloc, free};
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::unstable::intrinsics;
|
use std::unstable::intrinsics;
|
||||||
use std::util;
|
|
||||||
|
|
||||||
// a wrapper around the handle returned by the foreign code
|
// a wrapper around the handle returned by the foreign code
|
||||||
pub struct Unique<T> {
|
pub struct Unique<T> {
|
||||||
|
@ -186,7 +185,7 @@ pub impl<T: Owned> Unique<T> {
|
||||||
impl<T: Owned> Drop for Unique<T> {
|
impl<T: Owned> Drop for Unique<T> {
|
||||||
fn finalize(&self) {
|
fn finalize(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut x = intrinsics::init(); // dummy value to swap in
|
let x = intrinsics::init(); // dummy value to swap in
|
||||||
// moving the object out is needed to call the destructor
|
// moving the object out is needed to call the destructor
|
||||||
ptr::replace_ptr(self.ptr, x);
|
ptr::replace_ptr(self.ptr, x);
|
||||||
free(self.ptr as *c_void)
|
free(self.ptr as *c_void)
|
||||||
|
|
Loading…
Reference in a new issue