Skip to content

Commit 7dd9fa0

Browse files
committed
teeny pb cleanups
1 parent 4db775b commit 7dd9fa0

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

crates/pb/src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::fs;
1+
use std::{fs, process};
22

33
use anyhow::{Context, Result, bail};
44
use clap::Parser;
@@ -19,8 +19,6 @@ fn main() -> Result<()> {
1919
bail!("unsupported file format: .{ext}");
2020
}
2121
let file_path = cli.input.to_string_lossy().into_owned();
22-
23-
// Fast path: EPUB → HTML bypasses the text-buffer pipeline entirely.
2422
if !cli.metadata && matches!(cli.format, Format::Html) && ext == "epub" {
2523
let html = paperback_core::export::epub_direct::render(&file_path)
2624
.with_context(|| format!("failed to convert {}", cli.input.display()))?;
@@ -32,7 +30,6 @@ fn main() -> Result<()> {
3230
}
3331
};
3432
}
35-
3633
let mut context = ParserContext::new(file_path).with_render_tables_inline(true);
3734
if let Some(password) = cli.password {
3835
context = context.with_password(password);
@@ -42,7 +39,7 @@ fn main() -> Result<()> {
4239
Err(e) if e.to_string().starts_with(PASSWORD_REQUIRED_ERROR_PREFIX) => {
4340
if cli.no_prompt {
4441
eprintln!("pb: document requires a password; skipping (use -p to supply one)");
45-
std::process::exit(2);
42+
process::exit(2);
4643
}
4744
let password = rpassword::prompt_password("Password: ").context("failed to read password")?;
4845
context.password = Some(password);

0 commit comments

Comments
 (0)