use crate::book::isbn::ISBN;
use crate::book::read::Read;
pub mod isbn;
pub mod read;
#[derive(Debug)]
pub struct Book {
pub title: String,
pub isbn: ISBN,
pub pages: u32,
pub read: Read
}
impl Book {
pub fn finish(&mut self) {
self.read = Read::Finished;
}
pub fn summary(&self) -> String {
format!("The book `{}` is a {} pages long read and is catalogued under the ISBN {}\n{}", self.title, self.pages, self.isbn, self.isbn.print_qr_code())
}
}