print contents of .torrent file

PHOTO EMBED

Thu Jul 07 2022 09:46:08 GMT+0000 (Coordinated Universal Time)

Saved by @aaryaman #rust

use std::fs::File;
use std::io::Read;

fn main() {
    let path = "/home/aaryaman/projects/rusty/oxibit/Hawkeye.torrent";
    let mut torrent = File::open(path).unwrap();

    let mut buf = vec![];
    torrent.read_to_end(&mut buf);
    let contents = String::from_utf8_lossy(&buf);
    println!("{}", contents);
}
content_copyCOPY