From 2dcd300930ce6fea76b56240e0536abfff292ed0 Mon Sep 17 00:00:00 2001 From: xfy Date: Tue, 16 Jun 2026 17:12:35 +0800 Subject: [PATCH] build: allow dead_code on CommentCountResponse for WASM builds --- src/api/comments/types.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/comments/types.rs b/src/api/comments/types.rs index 9a0d208..8cf4c7c 100644 --- a/src/api/comments/types.rs +++ b/src/api/comments/types.rs @@ -33,7 +33,11 @@ pub struct CommentTreeResponse { } /// 评论计数响应。 +/// +/// 此类型仅在服务端函数体中构造;保留 `#[allow(dead_code)]` 以避免 WASM 构建中 +/// 因函数体被剥离而产生的未使用警告。 #[derive(Debug, Clone, Serialize, Deserialize)] +#[allow(dead_code)] pub struct CommentCountResponse { /// 评论数量。 pub count: i64,