rust: fix clippy compat with bindgen

and fix a couple of lints in plane.rs
pull/907/head
joseLuís 4 years ago
parent 4b9a8d130f
commit 6cfd3d6ad7

@ -3,6 +3,15 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
#![no_std] #![no_std]
#![allow(clippy::too_many_arguments)]
// see https://github.com/rust-lang/rust-bindgen/issues/1470
#[allow(clippy::all)]
mod bindings {
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
}
pub use bindings::*;
mod cells; mod cells;
mod channel; mod channel;
mod key; mod key;
@ -22,8 +31,6 @@ pub use pixel::*;
pub use plane::*; pub use plane::*;
pub use types::*; pub use types::*;
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use core::ptr::{null, null_mut}; use core::ptr::{null, null_mut};

@ -230,7 +230,7 @@ pub fn ncplane_dim_x(plane: &ncplane) -> i32 {
unsafe { unsafe {
let mut x = 0; let mut x = 0;
ffi::ncplane_dim_yx(plane, null_mut(), &mut x); ffi::ncplane_dim_yx(plane, null_mut(), &mut x);
return x; x
} }
} }
@ -241,7 +241,7 @@ pub fn ncplane_dim_y(plane: &ncplane) -> i32 {
unsafe { unsafe {
let mut y = 0; let mut y = 0;
ffi::ncplane_dim_yx(plane, &mut y, null_mut()); ffi::ncplane_dim_yx(plane, &mut y, null_mut());
return y; y
} }
} }
@ -353,7 +353,7 @@ pub fn ncplane_perimeter(plane: &mut ncplane, ul: &cell, ur: &cell, ll: &cell, l
/// ///
// TODO: TEST // TODO: TEST
#[inline] #[inline]
pub fn ncplane_putstr(plane: *mut ncplane, _str: &str) -> i32 { pub fn ncplane_putstr(plane: &mut ncplane, _str: &str) -> i32 {
unsafe { unsafe {
ffi::ncplane_putstr_yx( ffi::ncplane_putstr_yx(
plane, plane,

Loading…
Cancel
Save