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,
|
indexed: String,
|
||||||
magnet: String,
|
magnet: String,
|
||||||
scrape: Option<Scrape>,
|
scrape: Option<Scrape>,
|
||||||
size: u64,
|
size: usize,
|
||||||
torrent: Torrent,
|
torrent: Torrent,
|
||||||
}
|
}
|
||||||
let (total, torrents) = public
|
let (total, torrents) = public
|
||||||
|
|
@ -83,7 +83,7 @@ fn index(
|
||||||
indexed: torrent.time.format(&meta.format_time).to_string(),
|
indexed: torrent.time.format(&meta.format_time).to_string(),
|
||||||
magnet: torrent.magnet(meta.trackers.as_ref()),
|
magnet: torrent.magnet(meta.trackers.as_ref()),
|
||||||
scrape: scraper.scrape(&torrent.info_hash),
|
scrape: scraper.scrape(&torrent.info_hash),
|
||||||
size: torrent.size,
|
size: torrent.size as usize, // required by `filesizeformat` impl
|
||||||
torrent
|
torrent
|
||||||
}),
|
}),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|
@ -114,7 +114,7 @@ fn info(
|
||||||
struct F {
|
struct F {
|
||||||
href: Option<String>,
|
href: Option<String>,
|
||||||
path: String,
|
path: String,
|
||||||
size: u64,
|
size: usize,
|
||||||
}
|
}
|
||||||
let torrent = Torrent::from_public(&t.bytes, t.time).map_err(|e| {
|
let torrent = Torrent::from_public(&t.bytes, t.time).map_err(|e| {
|
||||||
error!("Torrent parse error: `{e}`");
|
error!("Torrent parse error: `{e}`");
|
||||||
|
|
@ -142,7 +142,7 @@ fn info(
|
||||||
F {
|
F {
|
||||||
href: public.href(&torrent.info_hash, &p),
|
href: public.href(&torrent.info_hash, &p),
|
||||||
path: p,
|
path: p,
|
||||||
size: f.length,
|
size: f.length as usize, // required by `filesizeformat` impl
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<F>>()
|
.collect::<Vec<F>>()
|
||||||
|
|
@ -150,7 +150,7 @@ fn info(
|
||||||
indexed: torrent.time.format(&meta.format_time).to_string(),
|
indexed: torrent.time.format(&meta.format_time).to_string(),
|
||||||
magnet: torrent.magnet(meta.trackers.as_ref()),
|
magnet: torrent.magnet(meta.trackers.as_ref()),
|
||||||
scrape: scraper.scrape(&torrent.info_hash),
|
scrape: scraper.scrape(&torrent.info_hash),
|
||||||
size: torrent.size,
|
size: torrent.size as usize, // required by `filesizeformat` impl
|
||||||
torrent
|
torrent
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue