mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-01 23:51:46 -04:00
Remove some more dead code
This commit is contained in:
-10
@@ -13,7 +13,6 @@ use crossterm::{
|
||||
}
|
||||
};
|
||||
use futures_util::{stream::StreamExt, FutureExt};
|
||||
// use glib::{LogField, LogLevel, LogWriterOutput};
|
||||
use notify::{Event, EventKind, RecursiveMode, Watcher};
|
||||
use ratatui::{backend::CrosstermBackend, Terminal};
|
||||
use ratatui_image::picker::Picker;
|
||||
@@ -161,11 +160,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut term = Terminal::new(backend)?;
|
||||
term.skip_diff(true);
|
||||
|
||||
// poppler has some annoying logging (e.g. if you request a page index out-of-bounds of a
|
||||
// document's pages, then it will return `None`, but still log to stderr with CRITICAL level),
|
||||
// so we want to just ignore all logging since this is a tui app.
|
||||
// glib::log_set_writer_func(noop);
|
||||
|
||||
execute!(
|
||||
term.backend_mut(),
|
||||
EnterAlternateScreen,
|
||||
@@ -286,7 +280,3 @@ fn on_notify_ev(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*fn noop(_: LogLevel, _: &[LogField<'_>]) -> LogWriterOutput {
|
||||
LogWriterOutput::Handled
|
||||
}*/
|
||||
|
||||
+1
-5
@@ -122,7 +122,6 @@ pub fn start_rendering(
|
||||
}
|
||||
};
|
||||
|
||||
//let n_pages = doc.page_count() as usize;
|
||||
let n_pages = match doc.page_count() {
|
||||
Ok(n) => n as usize,
|
||||
Err(e) => {
|
||||
@@ -351,10 +350,7 @@ fn render_single_page_to_ctx(
|
||||
|
||||
// then, get the size of the page
|
||||
let bounds = page.bounds()?;
|
||||
let (p_width, p_height) = (
|
||||
f32::from(bounds.x1 - bounds.x0),
|
||||
f32::from(bounds.y1 - bounds.y0)
|
||||
);
|
||||
let (p_width, p_height) = (bounds.x1 - bounds.x0, bounds.y1 - bounds.y0);
|
||||
|
||||
// and get its aspect ratio
|
||||
let p_aspect_ratio = p_width / p_height;
|
||||
|
||||
Reference in New Issue
Block a user