Use #[expect(lint)] over #[allow(lint)] where possible (#17822)

This commit is contained in:
Micha Reiser 2025-05-03 21:20:31 +02:00 committed by GitHub
parent 8535af8516
commit fa628018b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
148 changed files with 221 additions and 268 deletions

View file

@ -143,7 +143,7 @@ fn local_notification_task<'a, N: traits::SyncNotificationHandler>(
}))
}
#[allow(dead_code)]
#[expect(dead_code)]
fn background_notification_thread<'a, N: traits::BackgroundDocumentNotificationHandler>(
req: server::Notification,
schedule: BackgroundSchedule,

View file

@ -48,7 +48,7 @@ impl Client<'_> {
}
}
#[allow(dead_code)] // we'll need to use `Notifier` in the future
#[expect(dead_code)] // we'll need to use `Notifier` in the future
impl Notifier {
pub(crate) fn notify<N>(&self, params: N::Params) -> crate::Result<()>
where

View file

@ -106,7 +106,7 @@ impl Pool {
self.job_sender.send(job).unwrap();
}
#[allow(dead_code)]
#[expect(dead_code)]
pub(super) fn len(&self) -> usize {
self.extant_tasks.load(Ordering::SeqCst)
}

View file

@ -183,14 +183,14 @@ mod imp {
QoSClass::Background => libc::qos_class_t::QOS_CLASS_BACKGROUND,
};
#[allow(unsafe_code)]
#[expect(unsafe_code)]
let code = unsafe { libc::pthread_set_qos_class_self_np(c, 0) };
if code == 0 {
return;
}
#[allow(unsafe_code)]
#[expect(unsafe_code)]
let errno = unsafe { *libc::__error() };
match errno {
@ -223,10 +223,10 @@ mod imp {
}
pub(super) fn get_current_thread_qos_class() -> Option<QoSClass> {
#[allow(unsafe_code)]
#[expect(unsafe_code)]
let current_thread = unsafe { libc::pthread_self() };
let mut qos_class_raw = libc::qos_class_t::QOS_CLASS_UNSPECIFIED;
#[allow(unsafe_code)]
#[expect(unsafe_code)]
let code = unsafe {
libc::pthread_get_qos_class_np(current_thread, &mut qos_class_raw, std::ptr::null_mut())
};
@ -241,7 +241,7 @@ mod imp {
// ones which we cannot handle anyway
//
// 0: https://github.com/apple-oss-distributions/libpthread/blob/67e155c94093be9a204b69637d198eceff2c7c46/src/qos.c#L171-L177
#[allow(unsafe_code)]
#[expect(unsafe_code)]
let errno = unsafe { *libc::__error() };
unreachable!("`pthread_get_qos_class_np` failed unexpectedly (os error {errno})");
}