From 9693a2de838c642f860370fbabca1393cdee4e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Audiger?= Date: Mon, 12 Jan 2026 20:24:45 +0100 Subject: [PATCH 1/2] chore(brioche-packed): prefer usage of core:: instead of std:: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémy Audiger --- crates/brioche-packed-plain-exec/src/main.rs | 2 ++ crates/brioche-packed-userland-exec/src/linux.rs | 7 ++++--- crates/brioche-packed-userland-exec/src/main.rs | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/brioche-packed-plain-exec/src/main.rs b/crates/brioche-packed-plain-exec/src/main.rs index f1a8841..0228380 100644 --- a/crates/brioche-packed-plain-exec/src/main.rs +++ b/crates/brioche-packed-plain-exec/src/main.rs @@ -1,3 +1,5 @@ +#![warn(clippy::std_instead_of_core)] + use std::{ffi::OsString, os::unix::process::CommandExt as _, path::PathBuf, process::ExitCode}; use bstr::ByteSlice as _; diff --git a/crates/brioche-packed-userland-exec/src/linux.rs b/crates/brioche-packed-userland-exec/src/linux.rs index f0d9b1f..f9e21de 100644 --- a/crates/brioche-packed-userland-exec/src/linux.rs +++ b/crates/brioche-packed-userland-exec/src/linux.rs @@ -1,6 +1,7 @@ #![cfg(target_os = "linux")] -use std::ffi::{CStr, CString}; +use core::ffi::CStr; +use std::ffi::CString; use bstr::ByteSlice as _; @@ -162,8 +163,8 @@ enum PackedError { ResourceNotFound, } -impl std::fmt::Display for PackedError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl core::fmt::Display for PackedError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { f.write_str(error_summary(self)) } } diff --git a/crates/brioche-packed-userland-exec/src/main.rs b/crates/brioche-packed-userland-exec/src/main.rs index 56615d3..671c254 100644 --- a/crates/brioche-packed-userland-exec/src/main.rs +++ b/crates/brioche-packed-userland-exec/src/main.rs @@ -1,4 +1,5 @@ #![cfg_attr(all(target_os = "linux", not(test)), no_main)] +#![warn(clippy::std_instead_of_core)] mod linux; From bc6d4b8e221695963c983c772e4bfb0d669c5f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Audiger?= Date: Wed, 14 Jan 2026 20:47:39 +0100 Subject: [PATCH 2/2] chore: inherit from Clippy workspace configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémy Audiger --- crates/brioche-packed-userland-exec/Cargo.toml | 3 +++ crates/brioche-packed-userland-exec/src/linux.rs | 8 ++++++-- crates/brioche-packed-userland-exec/src/main.rs | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/brioche-packed-userland-exec/Cargo.toml b/crates/brioche-packed-userland-exec/Cargo.toml index 61544ae..8f19948 100644 --- a/crates/brioche-packed-userland-exec/Cargo.toml +++ b/crates/brioche-packed-userland-exec/Cargo.toml @@ -15,3 +15,6 @@ thiserror = "2.0.17" [target.'cfg(target_os = "linux")'.dependencies] userland-execve = "0.2.0" + +[lints] +workspace = true diff --git a/crates/brioche-packed-userland-exec/src/linux.rs b/crates/brioche-packed-userland-exec/src/linux.rs index f9e21de..1223a8e 100644 --- a/crates/brioche-packed-userland-exec/src/linux.rs +++ b/crates/brioche-packed-userland-exec/src/linux.rs @@ -12,7 +12,11 @@ unsafe extern "C" { } #[inline(always)] -#[allow(clippy::missing_safety_doc)] +#[allow( + clippy::inline_always, + clippy::missing_safety_doc, + clippy::similar_names +)] pub unsafe fn entrypoint(argc: libc::c_int, argv: *const *const libc::c_char) -> libc::c_int { let mut args = vec![]; let mut env_vars = vec![]; @@ -169,7 +173,7 @@ impl core::fmt::Display for PackedError { } } -fn error_summary(error: &PackedError) -> &'static str { +const fn error_summary(error: &PackedError) -> &'static str { match error { PackedError::IoError(_) => "io error", PackedError::ExtractPackError(error) => match error { diff --git a/crates/brioche-packed-userland-exec/src/main.rs b/crates/brioche-packed-userland-exec/src/main.rs index 671c254..12344be 100644 --- a/crates/brioche-packed-userland-exec/src/main.rs +++ b/crates/brioche-packed-userland-exec/src/main.rs @@ -6,7 +6,7 @@ mod linux; cfg_if::cfg_if! { if #[cfg(target_os = "linux")] { #[cfg_attr(not(test), unsafe(no_mangle))] - #[allow(clippy::missing_safety_doc)] + #[allow(clippy::missing_safety_doc, clippy::similar_names)] pub unsafe extern "C" fn main(argc: libc::c_int, argv: *const *const libc::c_char) -> libc::c_int { unsafe { linux::entrypoint(argc, argv)