mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
pixiv: drop unneeded mut bindings in ugoira extraction
This commit is contained in:
@@ -243,7 +243,7 @@ impl PixivAPI {
|
|||||||
}
|
}
|
||||||
// Uniform jpg or png per artwork; sniff the first entry's
|
// Uniform jpg or png per artwork; sniff the first entry's
|
||||||
// magic bytes instead of trusting its filename.
|
// magic bytes instead of trusting its filename.
|
||||||
let mut first = archive.by_index(0).map_err(|e| e.to_string())?;
|
let first = archive.by_index(0).map_err(|e| e.to_string())?;
|
||||||
let mut first_bytes = Vec::new();
|
let mut first_bytes = Vec::new();
|
||||||
first
|
first
|
||||||
.take(64 * 1024 * 1024 + 1)
|
.take(64 * 1024 * 1024 + 1)
|
||||||
@@ -268,7 +268,7 @@ impl PixivAPI {
|
|||||||
count += 1;
|
count += 1;
|
||||||
}
|
}
|
||||||
for i in 1..archive.len() {
|
for i in 1..archive.len() {
|
||||||
let mut entry = archive.by_index(i).map_err(|e| e.to_string())?;
|
let entry = archive.by_index(i).map_err(|e| e.to_string())?;
|
||||||
if entry.size() > 64 * 1024 * 1024 {
|
if entry.size() > 64 * 1024 * 1024 {
|
||||||
return Err(format!("frame {i} exceeds size cap"));
|
return Err(format!("frame {i} exceeds size cap"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user