From eb91913eade8eb4f43a4456aebfe99f114af7365 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 20:56:46 +0000 Subject: [PATCH 1/4] fix(deps): update rust crate clap-verbosity-flag to v3 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fdc5442..3bf5698 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,9 +271,9 @@ dependencies = [ [[package]] name = "clap-verbosity-flag" -version = "2.2.3" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34c77f67047557f62582784fd7482884697731b2932c7d37ced54bce2312e1e2" +checksum = "42dcf89bb9d98abb02e9a4a8ef1cce429e547a803460a8245c399860985d5281" dependencies = [ "clap", "log", diff --git a/Cargo.toml b/Cargo.toml index 5a7c43f..d219e6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] clap = { version = "4.5.4", features = ["derive", "wrap_help"] } -clap-verbosity-flag = "2.2.0" +clap-verbosity-flag = "3.0.0" color-eyre = "0.6.3" crossterm = { version = "0.28.0", features = ["event-stream"] } futures = "0.3.30" From ded6e39505a2161edcfd9b51b29e6d4669fd1695 Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:09:41 +0100 Subject: [PATCH 2/4] chore: remove lint `pointer_structural_match` lint `pointer_structural_match` has been removed: converted into hard error, see [RFC #3535][3535] for more information. [3535]: https://rust-lang.github.io/rfcs/3535-constants-in-patterns.html --- src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7a345da..1611e7f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,7 +20,6 @@ #![deny( // fuzzy_provenance_casts, UNSTABLE: https://github.com/rust-lang/rust/issues/95228 // lossy_provenance_casts, UNSTABLE: https://github.com/rust-lang/rust/issues/95228 - pointer_structural_match, unsafe_code // Exceptions must be discussed and deemed indispensable and use `#![deny(invalid_reference_casting, unsafe_op_in_unsafe_fn)]`. )] // Opt-in to allowed-by-default clippy lints From 51c06dabdff8885238f8d3e4022fa4c8f084bb09 Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:11:23 +0100 Subject: [PATCH 3/4] chore: migrate from deprecated `ratatui::Frame::<'_>::size` to `::area` --- src/ui.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui.rs b/src/ui.rs index 22d4ce4..ebfd05a 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -220,7 +220,7 @@ impl Ui { let all_videos_read = Self::acquire_all_videos_sorted(all_videos.iter()).await; terminal.draw(|frame| { - let area = frame.size(); + let area = frame.area(); let chunks = layout::layout_chunks(area, &all_videos_read); From e3680508e8686a0a3209a0375be2265bff9ca890 Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:13:03 +0100 Subject: [PATCH 4/4] refactor: migrate to built-in `tracing` support of `clap-verbosity-flag` --- Cargo.lock | 3 +-- Cargo.toml | 3 +-- src/trace.rs | 26 ++------------------------ 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3bf5698..d69a134 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,7 +276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42dcf89bb9d98abb02e9a4a8ef1cce429e547a803460a8245c399860985d5281" dependencies = [ "clap", - "log", + "tracing-core", ] [[package]] @@ -2027,7 +2027,6 @@ dependencies = [ "futures", "htmlize", "json_dotpath", - "log", "nix", "once_cell", "opentelemetry", diff --git a/Cargo.toml b/Cargo.toml index d219e6a..f452630 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,13 +8,12 @@ publish = false [dependencies] clap = { version = "4.5.4", features = ["derive", "wrap_help"] } -clap-verbosity-flag = "3.0.0" +clap-verbosity-flag = { version = "3.0.0", default-features = false, features = ["tracing"] } color-eyre = "0.6.3" crossterm = { version = "0.28.0", features = ["event-stream"] } futures = "0.3.30" htmlize = { version = "1.0.5", features = ["unescape"] } json_dotpath = "1.1.0" -log = "0.4.21" nix = { version = "0.29.0", features = ["process", "signal"] } once_cell = "1.19.0" opentelemetry = "0.23" diff --git a/src/trace.rs b/src/trace.rs index f2e3eda..3e1c0e6 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -4,7 +4,7 @@ use opentelemetry::KeyValue; use opentelemetry_sdk::Resource; use tracing_appender::non_blocking::WorkerGuard; use tracing_error::ErrorLayer; -use tracing_subscriber::{filter::Directive, layer::SubscriberExt}; +use tracing_subscriber::layer::SubscriberExt; use tracing_subscriber::{prelude::*, EnvFilter}; use crate::args::Args; @@ -56,28 +56,6 @@ fn env_filter(verbosity: &Verbosity) -> EnvFilter { // or use `RUST_LOG=target[span{field=value}]=level` for fine-grained verbosity control. // See https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html tracing_subscriber::EnvFilter::builder() - .with_default_directive( - LogLevel::from(&verbosity.log_level().unwrap_or(log::Level::Error)).into_directive(), - ) + .with_default_directive(verbosity.tracing_level_filter().into()) .from_env_lossy() } - -pub(crate) struct LogLevel(tracing::Level); - -impl From<&log::Level> for LogLevel { - fn from(log_level: &log::Level) -> Self { - LogLevel(match log_level { - log::Level::Error => tracing::Level::ERROR, - log::Level::Warn => tracing::Level::WARN, - log::Level::Info => tracing::Level::INFO, - log::Level::Debug => tracing::Level::DEBUG, - log::Level::Trace => tracing::Level::TRACE, - }) - } -} - -impl LogLevel { - pub(crate) fn into_directive(self) -> Directive { - self.0.into() - } -}