use errors::ParseError;
use parse::EpubArchive;
use types::Book;
pub mod errors;
mod html_entities;
mod parse;
pub mod types;
mod util;
pub fn epub_to_book(bytes: &[u8]) -> Result<Book, ParseError> {
EpubArchive::new(bytes).and_then(|archive| archive.to_book())
}
#[cfg(test)]
mod tests {
use super::*;
static EPUB_PAID_OFF: &[u8] = include_bytes!("../../test_resources/paid_off.epub");
#[test]
fn epub_to_book_paid_off() {
let book = epub_to_book(EPUB_PAID_OFF).unwrap();
assert_eq!("Paid Off", &book.title);
}
}