Skip to content

Commit

Permalink
Fix lints for latest version of rust (#50)
Browse files Browse the repository at this point in the history
* Fix unexpected_cfgs lints

* Fix static_mut_refs lints

* Allow dead_code lint for pinned callbacks
  • Loading branch information
kira-bruneau committed Sep 19, 2024
1 parent 2ada364 commit 06a3de2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ version = '0.2.0'

[badges.maintenance]
status = 'passively-maintained'

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(abi4)', 'cfg(abi5)', 'cfg(abi6)'] }
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use num_traits::ToPrimitive;
use std::convert::{TryFrom, TryInto};
use std::ffi::{CStr, CString};
use std::os::raw::c_void;
use std::ptr::addr_of_mut;
use std::time::Duration;
use std::{mem, result};

Expand Down Expand Up @@ -1074,7 +1075,7 @@ pub enum CecConnectionResultError {
pub struct CecConnection(
pub CecConnectionCfg,
libcec_connection_t,
Pin<Box<CecCallbacks>>,
#[allow(dead_code)] Pin<Box<CecCallbacks>>,
);

impl CecConnection {
Expand Down Expand Up @@ -1325,14 +1326,14 @@ impl CecConnectionCfg {
libcec_sys::libcec_enable_callbacks(
connection.1,
rust_callbacks_as_void_ptr,
&mut CALLBACKS,
addr_of_mut!(CALLBACKS),
)
};
#[cfg(not(abi4))]
let callback_ret = unsafe {
libcec_sys::libcec_set_callbacks(
connection.1,
&mut CALLBACKS,
addr_of_mut!(CALLBACKS),
rust_callbacks_as_void_ptr,
)
};
Expand Down

0 comments on commit 06a3de2

Please sign in to comment.