From ec4e87a935d4576140051d018deb4df4ba35eccd Mon Sep 17 00:00:00 2001 From: Xiaobo Liu Date: Thu, 17 Jul 2025 17:02:39 +0800 Subject: [PATCH] aya-log: simplify EbpfLogger as_raw_fd implementation Replace struct pattern matching with direct field access in the as_raw_fd method, making the code more concise and cleaner. Signed-off-by: Xiaobo Liu --- aya-log/src/lib.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/aya-log/src/lib.rs b/aya-log/src/lib.rs index e34c3ba6..f6257428 100644 --- a/aya-log/src/lib.rs +++ b/aya-log/src/lib.rs @@ -100,11 +100,7 @@ pub struct EbpfLogger { impl AsRawFd for EbpfLogger { fn as_raw_fd(&self) -> std::os::unix::prelude::RawFd { - let Self { - ring_buf, - logger: _, - } = self; - ring_buf.as_raw_fd() + self.ring_buf.as_raw_fd() } }