File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- use std:: fs ;
1+ use std:: { fs , process } ;
22
33use anyhow:: { Context , Result , bail} ;
44use 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) ;
You can’t perform that action at this time.
0 commit comments