chore: clippy and rustfmt cleanup on new code

This commit is contained in:
2026-08-08 20:35:43 +08:00
parent c40b074b3c
commit 755330e585
6 changed files with 26 additions and 27 deletions
+1 -2
View File
@@ -24,8 +24,7 @@ type UrlJob = (Bot, Message, String);
static URL_JOBS: LazyLock<parking_lot::Mutex<Option<tokio::sync::mpsc::Sender<UrlJob>>>> =
LazyLock::new(|| parking_lot::Mutex::new(None));
/// Set by main's shutdown sequence; workers stop pulling new jobs.
static URL_STOP: std::sync::atomic::AtomicBool =
std::sync::atomic::AtomicBool::new(false);
static URL_STOP: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
/// Worker count draining URL jobs; keeps the old 8-permit concurrency cap
/// while bounding how many jobs can be queued at all.
+13 -6
View File
@@ -641,7 +641,12 @@ async fn send_batch_via_upload(
.map_err(|message| FallbackError::Permanent { message })?
}
PhotoPrep::UseFallback => match item.fallback_url() {
Some(url) => match media_from_url(item, url, item_caption, item.thumbnail_url()) {
Some(url) => match media_from_url(
item,
url,
item_caption,
item.thumbnail_url(),
) {
Ok(media) => media,
Err(message) => {
return Err(FallbackError::Permanent { message });
@@ -664,12 +669,14 @@ async fn send_batch_via_upload(
}
}
Err(FallbackError::MediaTooLarge) => match item.fallback_url() {
Some(url) => match media_from_url(item, url, item_caption, item.thumbnail_url()) {
Ok(media) => media,
Err(message) => {
return Err(FallbackError::Permanent { message });
Some(url) => {
match media_from_url(item, url, item_caption, item.thumbnail_url()) {
Ok(media) => media,
Err(message) => {
return Err(FallbackError::Permanent { message });
}
}
},
}
None => {
return Err(FallbackError::Permanent {
message: "media too large".into(),