style: rustfmt config.rs and main.rs from the last two features

This commit is contained in:
2026-08-13 22:43:35 +08:00
parent 6b9640aa48
commit 39260a8817
2 changed files with 11 additions and 10 deletions
+7 -9
View File
@@ -46,19 +46,17 @@ impl Config {
if !bad.is_empty() {
log::warn!("BOT_ADMIN: ignoring non-numeric ids: {bad:?}");
}
ids.into_iter().filter_map(|p| p.parse::<i64>().ok()).collect()
ids.into_iter()
.filter_map(|p| p.parse::<i64>().ok())
.collect()
}
Err(_) => Vec::new(),
};
let edit_message_ttl = Duration::from_secs(parse_u64(
"EDIT_MESSAGE_TTL_SECONDS",
24 * 3600,
));
let link_cache_ttl = Duration::from_secs(parse_u64(
"LINK_CACHE_TTL_SECONDS",
7 * 24 * 3600,
));
let edit_message_ttl =
Duration::from_secs(parse_u64("EDIT_MESSAGE_TTL_SECONDS", 24 * 3600));
let link_cache_ttl =
Duration::from_secs(parse_u64("LINK_CACHE_TTL_SECONDS", 7 * 24 * 3600));
let webhook_enabled = env::var("WEBHOOK")
.is_ok_and(|v| matches!(v.to_lowercase().as_str(), "true" | "yes" | "1"));
+4 -1
View File
@@ -191,7 +191,10 @@ async fn main() {
}
TASK_QUEUE.stop().await;
};
if tokio::time::timeout(SHUTDOWN_TIMEOUT, shutdown).await.is_err() {
if tokio::time::timeout(SHUTDOWN_TIMEOUT, shutdown)
.await
.is_err()
{
log::warn!("graceful shutdown timed out after {SHUTDOWN_TIMEOUT:?}; exiting");
} else {
log::info!("Bot stopped");