feat: Add zip parser
ref: Parsers now returns vector, not a single book
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::domain::author::Author;
|
||||
use crate::domain::book::Book;
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub fn parse(path: &PathBuf) -> Result<Book, String> {
|
||||
pub fn parse(path: &PathBuf) -> Result<Vec<Book>, String> {
|
||||
let mut book = Book::new();
|
||||
|
||||
book.title = path.to_string_lossy().to_string();
|
||||
@@ -11,5 +11,5 @@ pub fn parse(path: &PathBuf) -> Result<Book, String> {
|
||||
author.first_name = path.extension().unwrap().to_string_lossy().to_string();
|
||||
book.author.push(author);
|
||||
|
||||
return Ok(book);
|
||||
return Ok(vec![ book]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user