From 8eaa56c90659a06915f3af928d6886817dab1204 Mon Sep 17 00:00:00 2001 From: Cno Date: Sun, 14 Jul 2024 01:37:21 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E6=97=B6update=20index=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 09f92ae4..cc010aed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -160,10 +160,14 @@ fn router(action: Action) -> Result { .map(|name| format!("Success:Index of mirror '{name}' has been updated")) } else { mirror_update_all().map(|names| { - format!( - "Success:Index of mirrors '({name})' has been updated", - name = names.join(", ") - ) + if names.is_empty() { + "Warning:No mirror has been added".to_string() + } else { + format!( + "Success:Index of mirrors '({name})' has been updated", + name = names.join(", ") + ) + } }) } }