From 7c46b8062cc45f4e43b3054e2b802c2a00ddbd5b Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Wed, 11 Dec 2024 12:33:07 +0100 Subject: [PATCH] remove unused dependencies --- Cargo.lock | 8 -------- Cargo.toml | 6 ++---- src/main.rs | 8 +++++--- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c4fe4f..60b4563 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -563,12 +563,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" -[[package]] -name = "debug_print" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f215f9b7224f49fb73256115331f677d868b34d18b65dbe4db392e6021eea90" - [[package]] name = "digest" version = "0.10.7" @@ -662,9 +656,7 @@ dependencies = [ "bytes", "chrono", "criterion", - "debug_print", "futures", - "futures-util", "headers", "image", "rand", diff --git a/Cargo.toml b/Cargo.toml index 7f87449..5e72391 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,15 +5,13 @@ edition = "2021" [dependencies] async-trait = "0.1.83" -atoi_radix10 = "0.0.1" +atoi_radix10 = { version = "0.0.1", optional = true } axum = { version = "0.7.7", features = ["ws"] } axum-extra = { version = "0.9.4", features = ["typed-header"] } axum-streams = "0.19.0" bytes = "1.6.0" chrono = "0.4.38" -debug_print = "1.0.0" futures = "0.3.31" -futures-util = { version = "0.3.31", features = ["sink", "std"] } headers = "0.4.0" image = "0.25.2" rand = "*" @@ -27,7 +25,7 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } [features] default = ["text", "binary"] -text = [] +text = ["dep:atoi_radix10"] binary = [] [dev-dependencies] diff --git a/src/main.rs b/src/main.rs index 3581e50..74483e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,6 @@ use std::{ time::Duration, }; -use chrono::Local; use flurry::{ config::{GRID_LENGTH, HOST, IMAGE_SAVE_INTERVAL, JPEG_UPDATE_INTERVAL}, flutclient::{FlutClient, ParserTypes}, @@ -39,13 +38,16 @@ async fn save_image_frames( grids: Arc<[grid::Flut; GRID_LENGTH]>, duration: Duration, ) -> AsyncResult { - let base_dir = Path::new("./recordings"); let mut timer = interval(duration); + let base_dir = Path::new("./recordings"); create_dir_all(base_dir)?; loop { timer.tick().await; for grid in grids.as_ref() { - let p = base_dir.join(format!("{}", Local::now().format("%Y-%m-%d_%H-%M-%S.jpg"))); + let p = base_dir.join(format!( + "{}", + chrono::Local::now().format("%Y-%m-%d_%H-%M-%S.jpg") + )); let mut file_writer = File::create(p)?; file_writer.write_all(&grid.read_jpg_buffer())?;