Skip to content

Commit 178cedf

Browse files
committed
revert recommened terminal size
switched from using cbor to bincode since why cbor?
1 parent 396dee3 commit 178cedf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ lazy_static = "1.5"
2020
tempfile = "3.20"
2121
hound = "3.5"
2222
serde = { version = "1.0", features = ["derive"] }
23-
serde_cbor = "0.11.2"
23+
bincode = "1.3.3"
2424
log4rs = "1.3.0"
2525

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ fn run_app() -> Result<(), AppError> {
6161

6262
let terminal_size = TerminalManager::get_size()?;
6363
log::info!("Terminal size: {}x{}", terminal_size.0, terminal_size.1);
64-
if terminal_size.0 < 100 || terminal_size.1 < 80 {
64+
if terminal_size.0 < 30 || terminal_size.1 < 20 {
6565
log::warn!(
66-
"Terminal size ({},{}) is smaller than recommended ({},{}). Playback might be suboptimal.",
66+
"Terminal size ({}x{}) is smaller than recommended ({}x{}). Playback might be suboptimal.",
6767
terminal_size.0,
6868
terminal_size.1,
69-
100,
70-
80
69+
30,
70+
20
7171
);
7272
}
7373

src/storage.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::ascii::RleFrame;
22
use crate::config::{ACSV_MAGIC, ACSV_VERSION, ZSTD_COMPRESSION_LEVEL};
33
use crate::error::AppError;
44
use indicatif::{ProgressBar, ProgressStyle};
5-
use serde_cbor;
5+
use bincode;
66
use sha2::{Digest, Sha256};
77
use std::fs::{self, File};
88
use std::io::{Read, Write};
@@ -29,7 +29,7 @@ pub fn save_ascii_frames(file_path: &Path, rle_frames: &[RleFrame]) -> Result<()
2929
);
3030
pb_encode.enable_steady_tick(Duration::from_millis(100));
3131

32-
let serialized_frames_data = serde_cbor::to_vec(&rle_frames)
32+
let serialized_frames_data = bincode::serialize(&rle_frames)
3333
.map_err(|e| AppError::CacheWrite(format!("Frames serialization failed: {}", e)))?;
3434

3535
pb_encode.finish_and_clear();
@@ -199,7 +199,7 @@ pub fn load_ascii_frames(file_path: &Path) -> Result<Vec<RleFrame>, AppError> {
199199
);
200200
pb_decode.enable_steady_tick(Duration::from_millis(100));
201201

202-
let rle_frames: Vec<RleFrame> = serde_cbor::from_slice(serialized_frames_data)
202+
let rle_frames: Vec<RleFrame> = bincode::deserialize(serialized_frames_data)
203203
.map_err(|e| AppError::CacheRead(format!("Frames deserialization failed: {}", e)))?;
204204

205205
pb_decode.set_position(frame_count as u64);

0 commit comments

Comments
 (0)