rust: Drop trait doesn't work with &muts; del impls

pull/1181/head
joseLuís 4 years ago
parent 2483771af1
commit e822e85a14

@ -27,11 +27,3 @@ impl NcDirect {
&mut *ncdirect_init(null(), null_mut(), flags)
}
}
impl Drop for NcDirect {
fn drop(&mut self) {
unsafe {
crate::ncdirect_stop(self);
}
}
}

@ -84,7 +84,7 @@ impl Notcurses {
unsafe { &mut *notcurses_init(&options, null_mut()) }
}
/// Returns a Notcurses context, with banners.
/// Returns a Notcurses context, with banners. The default in the C library.
pub fn with_banners<'a>() -> &'a mut Notcurses {
unsafe { &mut *notcurses_init(&NotcursesOptions::new(), null_mut()) }
}
@ -141,16 +141,3 @@ impl Notcurses {
unsafe { crate::notcurses_render(self) }
}
}
// Common Traits ---------------------------------------------------------------
impl Drop for Notcurses {
fn drop(&mut self) {
unsafe {
crate::notcurses_stop(self);
}
}
}
// impl fmt::Display for Notcurses {
// }

@ -179,9 +179,3 @@ impl NcPlane {
unsafe { &mut *crate::ncpile_top(self) }
}
}
impl Drop for NcPlane {
fn drop(&mut self) {
unsafe { crate::ncplane_destroy(self); }
}
}

@ -1,6 +1,6 @@
//! `ncvisual`
// TODO: implement constructors & Drop
// TODO: implement constructors
// functions already exported by bindgen : 17
// -----------------------------------------

@ -20,14 +20,6 @@ impl NcMenu {
}
}
impl Drop for NcMenu {
fn drop(&mut self) {
unsafe {
crate::ncmenu_destroy(self);
}
}
}
/// # `NcMenuOptions` Constructors
impl NcMenuOptions {
/// `NcMenuOptions` simple constructor

@ -1,7 +1,5 @@
//! `NcMultiSelector` widget.
// TODO: implement constructors & Drop
/// high-level widget for selecting items from a set
pub type NcMultiSelector = crate::bindings::bindgen::ncmultiselector;

@ -1,7 +1,5 @@
//! `NcPlot[F|U]64` widget.
// TODO: implement constructors & Drop
/// A histogram, bound to an [`NcPlane`][crate::NcPlane]
/// (uses non-negative `f64`s)
pub type NcPlotF64 = crate::bindings::bindgen::ncdplot;

@ -29,12 +29,3 @@ impl NcReader {
&mut *ncreader_create(plane, options)
}
}
impl Drop for NcReader {
/// Destroys the NcReader and its bound [NcPlane].
///
/// See the `destroy` method or `ncreader_destroy` for more options.
fn drop(&mut self) {
unsafe { crate::ncreader_destroy(self, core::ptr::null_mut()); }
}
}

@ -1,7 +1,5 @@
//! `NcReel` widget.
// TODO: implement constructors & Drop
/// A wheel with `NcTablet`s on the outside
///
/// An `NcReel` is projected onto the 2d rendering area, showing some portion of

@ -1,7 +1,5 @@
//! `NcSelector` widget.
// TODO: implement constructors & Drop
/// high-level widget for selecting one item from a set
pub type NcSelector = crate::bindings::bindgen::ncselector;

Loading…
Cancel
Save