rust: adapt to non-const ncdirect_get_{xy}() #1789

This commit is contained in:
nick black 2021-06-19 00:11:36 -04:00
parent 534000cadb
commit b3ed98b686
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -500,21 +500,21 @@ impl NcDirect {
/// Gets the current number of rows.
///
/// *C style function: [ncdirect_dim_y()][crate::ncdirect_dim_y].*
pub fn dim_y(&self) -> NcDim {
pub fn dim_y(mut &self) -> NcDim {
unsafe { crate::ncdirect_dim_y(self) as NcDim }
}
/// Gets the current number of columns.
///
/// *C style function: [ncdirect_dim_x()][crate::ncdirect_dim_x].*
pub fn dim_x(&self) -> NcDim {
pub fn dim_x(mut &self) -> NcDim {
unsafe { crate::ncdirect_dim_x(self) as NcDim }
}
/// Gets the current number of rows and columns.
///
/// *C style function: [ncdirect_dim_y()][crate::ncdirect_dim_y].*
pub fn dim_yx(&self) -> (NcDim, NcDim) {
pub fn dim_yx(mut &self) -> (NcDim, NcDim) {
let y = unsafe { crate::ncdirect_dim_y(self) as NcDim };
let x = unsafe { crate::ncdirect_dim_x(self) as NcDim };
(y, x)