mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
chore: clippy and rustfmt cleanup on new code
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user