fb2 0.4.4

Parser of the FB2 format
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::fs::File;
use std::io::{BufReader, Read};

use fb2::FictionBook;

pub fn compare(path: &str, expected: FictionBook) {
    let file = File::open(path).unwrap();
    let mut reader = BufReader::new(file);
    let mut content = String::new();
    reader.read_to_string(&mut content).unwrap();

    let book: FictionBook = quick_xml::de::from_str(&content).unwrap();

    assert_eq!(book, expected);
}