fix: Minor bugfix
This commit is contained in:
@@ -70,7 +70,10 @@ impl Books {
|
||||
pub fn add_books_from_path(&mut self) {
|
||||
let books = fs::Loader::new(PathBuf::from(&self.root))
|
||||
.into_iter()
|
||||
.map(|mut book| {book.source = book.source.strip_prefix(&self.root).unwrap().into(); book})
|
||||
.map(|mut book| {match book.source.strip_prefix(&self.root) {
|
||||
Ok(path) => book.source = path.to_path_buf(),
|
||||
Err(err) => eprintln!("strip source prefix: {}", err)
|
||||
}; book})
|
||||
.collect();
|
||||
|
||||
match self.repo.lock() {
|
||||
|
||||
Reference in New Issue
Block a user