From 27ed605223673375d314719ad84ea616f8e3412b Mon Sep 17 00:00:00 2001 From: xfy Date: Wed, 15 Jul 2026 18:12:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(comments):=20=E4=BF=AE=E5=A4=8D=20section.r?= =?UTF-8?q?s=20/=20dashboard.rs=20=E6=8B=AC=E5=8F=B7=E4=B8=8D=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E5=AF=BC=E8=87=B4=E7=BC=96=E8=AF=91=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 两处同一类错误:match arm 内 `if {} else {}` 表达式后多了一个 `}`, 导致 arm 被提前关闭,触发 "unexpected closing delimiter" 编译错误。 - section.rs:125 — `if !has_any {…}` 块后多余的 `}`,删除使 if-else 合一 - dashboard.rs:119 — 同类问题,另需补 `;` 终止 `let` 语句 --- src/components/comments/section.rs | 1 - src/pages/admin/dashboard.rs | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/comments/section.rs b/src/components/comments/section.rs index 0251b23..e2f25a6 100644 --- a/src/components/comments/section.rs +++ b/src/components/comments/section.rs @@ -121,7 +121,6 @@ pub fn CommentSection(post_id: i32) -> Element { rsx! { p { class: "text-paper-tertiary text-center py-8", "暂无评论,成为第一个评论的人吧!" } } - } } else { rsx! { CommentList { diff --git a/src/pages/admin/dashboard.rs b/src/pages/admin/dashboard.rs index 69d2efe..c78ff30 100644 --- a/src/pages/admin/dashboard.rs +++ b/src/pages/admin/dashboard.rs @@ -115,8 +115,7 @@ pub fn Admin() -> Element { "text-[var(--color-paper-secondary)]", "text-[var(--color-paper-primary)]", ) - } - } + }; rsx! { div { class: "text-sm font-medium {color_class}", "待审评论" } div { class: "flex items-baseline justify-between mt-4",