From 49e5a557caa0753e312419237cc9651ac7136324 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Mon, 10 Nov 2025 09:23:30 +0800 Subject: [PATCH] refactor: add inline annotations to CommandChildGuard methods --- src-tauri/src/process/guard.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src-tauri/src/process/guard.rs b/src-tauri/src/process/guard.rs index 0ffb89990..d1a41ab50 100644 --- a/src-tauri/src/process/guard.rs +++ b/src-tauri/src/process/guard.rs @@ -7,6 +7,7 @@ use crate::{logging, utils::logging::Type}; pub struct CommandChildGuard(Option); impl Drop for CommandChildGuard { + #[inline] fn drop(&mut self) { if let Err(err) = self.kill() { logging!( @@ -20,10 +21,12 @@ impl Drop for CommandChildGuard { } impl CommandChildGuard { + #[inline] pub const fn new(child: CommandChild) -> Self { Self(Some(child)) } + #[inline] pub fn kill(&mut self) -> Result<()> { if let Some(child) = self.0.take() { let _ = child.kill(); @@ -31,6 +34,7 @@ impl CommandChildGuard { Ok(()) } + #[inline] pub fn pid(&self) -> Option { self.0.as_ref().map(|c| c.pid()) }