metainfo parsing
This commit is contained in:
@@ -6,6 +6,7 @@ use std::io::{self, Read};
|
||||
use std::str;
|
||||
|
||||
use magnolia::bencode::*;
|
||||
use magnolia::metainfo::Metainfo;
|
||||
|
||||
fn load_file(path: &str) -> io::Result<()> {
|
||||
let mut buf = Vec::new();
|
||||
@@ -13,7 +14,8 @@ fn load_file(path: &str) -> io::Result<()> {
|
||||
f.read_to_end(&mut buf)?;
|
||||
|
||||
let obj = decode(&buf).unwrap();
|
||||
println!("{:#?}", obj);
|
||||
let meta = Metainfo::from_bencode(obj);
|
||||
println!("{:#?}", meta);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user