store file names as the PathBuf

This commit is contained in:
yggverse 2025-08-09 20:07:59 +03:00
parent 88dfbab0f7
commit bff6b209c9
4 changed files with 20 additions and 27 deletions

View file

@ -102,7 +102,7 @@ fn info(
#[derive(Serialize)]
#[serde(crate = "rocket::serde")]
struct F {
name: String,
path: String,
size: String,
}
let torrent = Torrent::from_storage(&t.bytes, t.time).map_err(|e| {
@ -118,7 +118,7 @@ fn info(
files_list: torrent.files.as_ref().map(|f| {
f.iter()
.map(|f| F {
name: f.name(),
path: f.path(),
size: f.size(),
})
.collect::<Vec<F>>()