diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/epub.rs | 4 | ||||
-rw-r--r-- | src/main.rs | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/epub.rs b/src/epub.rs index f850add..d74bd2a 100644 --- a/src/epub.rs +++ b/src/epub.rs @@ -47,11 +47,11 @@ impl Epub { match n.tag_name().name() { "h1" | "h2" | "h3" | "h4" | "h5" | "h6" => { - buf.push_str("\n\x1b\x5b1m"); + buf.push_str("\n\x1b[1m"); for c in n.children() { Self::render(buf, c); } - buf.push_str("\x1b\x5b0m\n"); + buf.push_str("\x1b[0m\n"); } "blockquote" | "p" | "tr" => { buf.push('\n'); diff --git a/src/main.rs b/src/main.rs index 8914f4f..dffbfff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -530,8 +530,7 @@ struct Props { fn restore(save_path: &str) -> Option<(String, Props)> { let args: Args = argh::from_env(); let width = args.width; - let path = args.path - .and_then(|s| Some(fs::canonicalize(s).unwrap().to_str().unwrap().to_string())); + let path = args.path.map(|s| fs::canonicalize(s).unwrap().to_str().unwrap().to_string()); let save = fs::read_to_string(save_path).and_then(|s| { let mut lines = s.lines(); Ok(( |