BREAKING CHANGE: improvement(lib): use u64 for Printer::display_offset and Squeezer::process, not usize

Technically a breaking change for architectures where
`size_of::<usize>() > size_of::<u64>()`, but that strikes me as
extremely unlikely.

This change is important because most file seek offsets, even on older
architectures with word sizes smaller than `u32`, accept a `u64`. In
particular, Rust's own `std` acknowledges this. So, we're actually going
against prior art in Rust by using a `usize`.
This commit is contained in:
Erich Gubler authored and David Peter committed 2020-06-07 11:08:01 +02:00
1 parent c5c8d1190f
commit 6d5c61b671
3 files changed
+22 -20

No files matched your search

+1 -1
View File
@@ -149,7 +149,7 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
let mut stdout_lock = stdout.lock();
let mut printer = Printer::new(&mut stdout_lock, show_color, border_style, squeeze);
printer.display_offset(display_offset as usize);
printer.display_offset(display_offset);
printer.print_all(&mut reader)?;
Ok(())