From 66ec14662cfa429620ea3c942887606f1f0390cd Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Thu, 24 Sep 2026 20:48:14 +0800 Subject: [PATCH] style: simplify inline answer returns --- crates/xmedia-bot/src/handlers/inline.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/xmedia-bot/src/handlers/inline.rs b/crates/xmedia-bot/src/handlers/inline.rs index 14190a1..16b0eba 100644 --- a/crates/xmedia-bot/src/handlers/inline.rs +++ b/crates/xmedia-bot/src/handlers/inline.rs @@ -228,12 +228,8 @@ async fn answer_inline_query( caption.clone().into_owned(), )); } - // Every item was skipped, or the post has no media at all: answer - // *empty* rather than leaving the query unanswered (a client keeps - // spinning on that, and the debounce's release re-runs the fetch on - // every keystroke). answer(ctx.sender, query.id, results).await?; - return Ok(true); + Ok(true) } Ok(None) | Err(_) => { if let Err(e) = answer(ctx.sender, query.id, Vec::new()).await { @@ -243,7 +239,7 @@ async fn answer_inline_query( ); return Err(e); } - return Ok(true); + Ok(true) } } }