From 40a6db94def5b86a502bbb7f4ae9379a0318b49c Mon Sep 17 00:00:00 2001 From: Gambhiro Date: Wed, 27 Nov 2019 09:02:13 +0000 Subject: [PATCH] xlsx --- src/dict_word.rs | 1 + src/ebook.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dict_word.rs b/src/dict_word.rs index 8cdc949..c2fde8f 100644 --- a/src/dict_word.rs +++ b/src/dict_word.rs @@ -49,6 +49,7 @@ pub struct DictWordXlsx { #[serde(default)] pub also_written_as: String, + #[serde(default)] pub definition_md: String, } diff --git a/src/ebook.rs b/src/ebook.rs index 37d18ac..ce18150 100644 --- a/src/ebook.rs +++ b/src/ebook.rs @@ -670,7 +670,7 @@ impl Ebook { let file_content = self .asset_files_byte .get(filename.to_str().unwrap()) - .ok_or("missing get key")?; + .ok_or_else(|| format!("cover_path not found: {}", self.meta.cover_path))?; let mut file = File::create(oebps_dir.join(filename))?; file.write_all(file_content)?; } @@ -682,7 +682,7 @@ impl Ebook { let file_content = self .asset_files_byte .get(&filename.to_string()) - .ok_or("missing get key")?; + .ok_or("style.css not found")?; let mut file = File::create(oebps_dir.join(filename))?; file.write_all(file_content)?; }