mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 09:05:30 +00:00
cast usize for filesizeformat
This commit is contained in:
parent
f95c9526f2
commit
671ef0854a
1 changed files with 5 additions and 5 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -33,7 +33,7 @@ fn index(
|
|||
indexed: String,
|
||||
magnet: String,
|
||||
scrape: Option<Scrape>,
|
||||
size: u64,
|
||||
size: usize,
|
||||
torrent: Torrent,
|
||||
}
|
||||
let (total, torrents) = public
|
||||
|
|
@ -83,7 +83,7 @@ fn index(
|
|||
indexed: torrent.time.format(&meta.format_time).to_string(),
|
||||
magnet: torrent.magnet(meta.trackers.as_ref()),
|
||||
scrape: scraper.scrape(&torrent.info_hash),
|
||||
size: torrent.size,
|
||||
size: torrent.size as usize, // required by `filesizeformat` impl
|
||||
torrent
|
||||
}),
|
||||
Err(e) => {
|
||||
|
|
@ -114,7 +114,7 @@ fn info(
|
|||
struct F {
|
||||
href: Option<String>,
|
||||
path: String,
|
||||
size: u64,
|
||||
size: usize,
|
||||
}
|
||||
let torrent = Torrent::from_public(&t.bytes, t.time).map_err(|e| {
|
||||
error!("Torrent parse error: `{e}`");
|
||||
|
|
@ -142,7 +142,7 @@ fn info(
|
|||
F {
|
||||
href: public.href(&torrent.info_hash, &p),
|
||||
path: p,
|
||||
size: f.length,
|
||||
size: f.length as usize, // required by `filesizeformat` impl
|
||||
}
|
||||
})
|
||||
.collect::<Vec<F>>()
|
||||
|
|
@ -150,7 +150,7 @@ fn info(
|
|||
indexed: torrent.time.format(&meta.format_time).to_string(),
|
||||
magnet: torrent.magnet(meta.trackers.as_ref()),
|
||||
scrape: scraper.scrape(&torrent.info_hash),
|
||||
size: torrent.size,
|
||||
size: torrent.size as usize, // required by `filesizeformat` impl
|
||||
torrent
|
||||
},
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue