aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Campos <james.r.campos@gmail.com>2020-07-16 21:35:10 -0700
committerJames Campos <james.r.campos@gmail.com>2020-07-16 21:35:10 -0700
commit4267d38a53bfa82ab5c8bcdfdc3eb8f3a4691e38 (patch)
treeaa22aaf12dad4fa1d3db25a541c02bcd121091ed
parent3b0838a611990bead1544a6660b07b15d6fe2024 (diff)
downloadbk-4267d38a53bfa82ab5c8bcdfdc3eb8f3a4691e38.tar.gz
clippy
-rw-r--r--src/epub.rs4
-rw-r--r--src/main.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/epub.rs b/src/epub.rs
index 7cce777..55a5726 100644
--- a/src/epub.rs
+++ b/src/epub.rs
@@ -115,8 +115,8 @@ impl Epub {
let doc = Document::parse(&xml)?;
epub3(doc, &mut nav);
} else {
- let toc = spine_node.attribute("toc").unwrap_or("ncx");
- let path = manifest.get(toc).unwrap();
+ let id = spine_node.attribute("toc").unwrap_or("ncx");
+ let path = manifest.get(id).unwrap();
let xml = self.get_text(&format!("{}{}", rootdir, path));
let doc = Document::parse(&xml)?;
epub2(doc, &mut nav);
diff --git a/src/main.rs b/src/main.rs
index b46defc..50e7a4c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -693,7 +693,7 @@ fn init() -> Result<State> {
// XXX will silently create a new default save if ron errors but path arg works.
// revisit if/when stabilizing. ez file format upgrades
let save = fs::read_to_string(&save_path)
- .map_err(|e| anyhow::Error::new(e))
+ .map_err(anyhow::Error::new)
.and_then(|s| {
let save: Save = ron::from_str(&s)?;
Ok(save)