mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-02 08:01:47 -04:00
Remove some more dead code
This commit is contained in:
Generated
+2
-2
@@ -1967,9 +1967,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.20.2"
|
||||
version = "1.20.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
|
||||
checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
|
||||
|
||||
[[package]]
|
||||
name = "oorandom"
|
||||
|
||||
+1
-4
@@ -21,8 +21,6 @@ path = "src/main.rs"
|
||||
name = "tdf"
|
||||
|
||||
[dependencies]
|
||||
# poppler-rs = { version = "0.24.1", default-features = false, features = ["v23_7"] }
|
||||
# cairo-rs = { version = "0.20.0", default-features = false, features = ["png"] }
|
||||
# we're using this branch because it has significant performance fixes that I'm waiting on responses from the upstream devs to get upstreamed. See https://github.com/ratatui-org/ratatui/issues/1116
|
||||
ratatui = { git = "https://github.com/itsjunetime/ratatui.git" }
|
||||
# ratatui = { path = "./ratatui/ratatui" }
|
||||
@@ -30,11 +28,10 @@ ratatui = { git = "https://github.com/itsjunetime/ratatui.git" }
|
||||
ratatui-image = { git = "https://github.com/itsjunetime/ratatui-image.git", branch = "vb64_on_personal", default-features = false }
|
||||
# ratatui-image = { path = "./ratatui-image", features = ["vb64"], default-features = false }
|
||||
crossterm = { version = "0.28.1", features = ["event-stream"] }
|
||||
image = { version = "0.25.1", features = ["pnm", "bmp", "rayon"], default-features = false }
|
||||
image = { version = "0.25.1", features = ["pnm", "rayon"], default-features = false }
|
||||
notify = { version = "8.0.0", features = ["crossbeam-channel"] }
|
||||
tokio = { version = "1.37.0", features = ["rt-multi-thread", "macros"] }
|
||||
futures-util = { version = "0.3.30", default-features = false }
|
||||
# glib = "0.20.0"
|
||||
itertools = "*"
|
||||
flume = { version = "0.11.0", default-features = false, features = ["async"] }
|
||||
xflags = "0.4.0-pre.2"
|
||||
|
||||
-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