From 3fed537854e35f3fa3e83c2a7648b983f24fa9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?joseLu=C3=ADs?= Date: Mon, 21 Jun 2021 19:44:55 +0200 Subject: [PATCH] [rust] remove NcDirectV type alias, use NcPlane instead --- rust/src/direct/methods.rs | 10 +++++----- rust/src/plane/mod.rs | 3 --- rust/src/visual/methods.rs | 6 +++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/rust/src/direct/methods.rs b/rust/src/direct/methods.rs index 9b516f68f..99534f847 100644 --- a/rust/src/direct/methods.rs +++ b/rust/src/direct/methods.rs @@ -5,8 +5,8 @@ use core::ptr::{null, null_mut}; use crate::ffi::sigset_t; use crate::{ cstring, error, error_ref_mut, rstring, NcAlign, NcBlitter, NcCapabilities, NcChannels, - NcComponent, NcDim, NcDirect, NcDirectFlags, NcDirectV, NcEgc, NcError, NcInput, NcOffset, - NcPaletteIndex, NcResult, NcRgb, NcScale, NcStyle, NcTime, NCRESULT_ERR, + NcComponent, NcDim, NcDirect, NcDirectFlags, NcEgc, NcError, NcInput, NcOffset, NcPaletteIndex, + NcPlane, NcResult, NcRgb, NcScale, NcStyle, NcTime, NCRESULT_ERR, }; /// # `NcDirect` constructors and destructors @@ -68,7 +68,7 @@ impl NcDirect { /// and writes it to the output. /// /// *C style function: [ncdirect_raster_frame()][crate::ncdirect_raster_frame].* - pub fn raster_frame(&mut self, frame: &mut NcDirectV, align: NcAlign) -> NcResult<()> { + pub fn raster_frame(&mut self, frame: &mut NcPlane, align: NcAlign) -> NcResult<()> { error![ unsafe { crate::ncdirect_raster_frame(self, frame, align) }, "NcDirect.raster_frame()" @@ -94,7 +94,7 @@ impl NcDirect { scale: NcScale, max_y: NcDim, max_x: NcDim, - ) -> NcResult<&'a mut NcDirectV> { + ) -> NcResult<&'a mut NcPlane> { let res = unsafe { crate::ncdirect_render_frame( self, @@ -664,7 +664,7 @@ impl NcDirect { /// Draws a box with its upper-left corner at the current cursor position, /// having dimensions `ylen` * `xlen`. /// - /// See NcPlane.[box()][crate::NcPlane#method.box] for more information. + /// See NcPlane.[box()][NcPlane#method.box] for more information. /// /// The minimum box size is 2x2, and it cannot be drawn off-screen. /// diff --git a/rust/src/plane/mod.rs b/rust/src/plane/mod.rs index 9422d331f..8fb95f355 100644 --- a/rust/src/plane/mod.rs +++ b/rust/src/plane/mod.rs @@ -271,9 +271,6 @@ pub use reimplemented::*; /// pub type NcPlane = crate::bindings::ffi::ncplane; -/// A type alias of [`NcPlane`] to be used in [`NcDirect`][crate::NcDirect] mode. -pub type NcDirectV = NcPlane; - /// Options struct for [`NcPlane`] pub type NcPlaneOptions = crate::bindings::ffi::ncplane_options; diff --git a/rust/src/visual/methods.rs b/rust/src/visual/methods.rs index 66bbaeeaf..000450fac 100644 --- a/rust/src/visual/methods.rs +++ b/rust/src/visual/methods.rs @@ -5,8 +5,8 @@ use libc::c_void; use crate::{ cstring, error, error_ref_mut, rstring, Nc, NcBlitter, NcComponent, NcDim, NcDirect, NcDirectF, - NcDirectV, NcError, NcIntResult, NcPixel, NcPlane, NcResult, NcRgba, NcScale, NcTime, NcVGeom, - NcVisual, NcVisualOptions, NCBLIT_PIXEL, NCRESULT_ERR, + NcError, NcIntResult, NcPixel, NcPlane, NcResult, NcRgba, NcScale, NcTime, NcVGeom, NcVisual, + NcVisualOptions, NCBLIT_PIXEL, NCRESULT_ERR, }; /// # NcVisualOptions Constructors @@ -574,7 +574,7 @@ impl NcDirectF { &mut self, ncd: &mut NcDirect, options: &NcVisualOptions, - ) -> NcResult<&mut NcDirectV> { + ) -> NcResult<&mut NcPlane> { error_ref_mut![ unsafe { crate::ncdirectf_render(ncd, self, options) }, "NcVisual.render()"