Skip to content

Commit

Permalink
chore: Fix more clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
poljar committed Oct 14, 2024
1 parent 5484054 commit 485998e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/weechat/src/infolist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl<'a> InfolistItem<'a> {
unsafe { infolist_integer(self.ptr, name.as_ptr()) }
}

fn string(&'a self, name: &str) -> Option<Cow<str>> {
fn string(&self, name: &str) -> Option<Cow<str>> {
let name = LossyCString::new(name);

let infolist_string = self.weechat.get().infolist_string.unwrap();
Expand Down
6 changes: 4 additions & 2 deletions crates/weechat/src/weechat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::future::Future;
use std::{
ffi::{CStr, CString},
panic::PanicInfo,
panic::PanicHookInfo,
path::PathBuf,
ptr, vec,
};
Expand Down Expand Up @@ -139,7 +139,7 @@ impl Weechat {
Weechat { ptr }
}

fn panic_hook(info: &PanicInfo) {
fn panic_hook(info: &PanicHookInfo) {
let current_thread = std::thread::current();
let weechat_thread = Weechat::thread_id();

Expand Down Expand Up @@ -287,6 +287,7 @@ impl Weechat {

fn thread_id() -> std::thread::ThreadId {
*unsafe {
#[allow(static_mut_refs)]
WEECHAT_THREAD_ID.as_ref().expect(
"Weechat main thread ID wasn't found, plugin \
wasn't correctly initialized",
Expand All @@ -295,6 +296,7 @@ impl Weechat {
}

pub(crate) fn check_thread() {
#[allow(static_mut_refs)]
let weechat_thread_id = unsafe {
WEECHAT_THREAD_ID.as_ref().expect(
"Weechat main thread ID wasn't found, plugin \
Expand Down

0 comments on commit 485998e

Please sign in to comment.