aboutsummaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
authorSoispha Peetz <soispha@b-peetz.de>2026-11-28 17:21:33 +0100
committerSoispha Peetz <soispha@b-peetz.de>2026-11-28 17:21:33 +0100
commita0834356366ca27cd18db43632baa06b04094db2 (patch)
tree8826092b2461b2c45a349d39a01391e956db5571 /crates
parentchore(treewide): Update licenses headers (diff)
downloadyt-a0834356366ca27cd18db43632baa06b04094db2.zip
chore(treewide): Format
Diffstat (limited to '')
-rw-r--r--crates/yt/src/commands/download/implm/mod.rs5
-rw-r--r--crates/yt/src/commands/mod.rs5
-rw-r--r--crates/yt/src/commands/stats/implm.rs18
-rw-r--r--crates/yt_dlp/src/hooks.rs2
-rw-r--r--crates/yt_dlp/src/info_json.rs4
5 files changed, 17 insertions, 17 deletions
diff --git a/crates/yt/src/commands/download/implm/mod.rs b/crates/yt/src/commands/download/implm/mod.rs
index db1c299..00005dc 100644
--- a/crates/yt/src/commands/download/implm/mod.rs
+++ b/crates/yt/src/commands/download/implm/mod.rs
@@ -28,10 +28,7 @@ mod download;
impl DownloadCommand {
pub(in crate::commands) async fn implm(self, app: Arc<App>) -> Result<()> {
- let DownloadCommand {
- force,
- count
- } = self;
+ let DownloadCommand { force, count } = self;
let max_cache_size = app.config.download.max_cache_size.as_u64();
info!("Max cache size: '{}'", Bytes::new(max_cache_size));
diff --git a/crates/yt/src/commands/mod.rs b/crates/yt/src/commands/mod.rs
index ab27653..4b62716 100644
--- a/crates/yt/src/commands/mod.rs
+++ b/crates/yt/src/commands/mod.rs
@@ -45,7 +45,10 @@ mod videos;
mod watch;
#[derive(Subcommand, Debug)]
-#[expect(private_interfaces, reason = "Only the main `implm` method should be accessible.")]
+#[expect(
+ private_interfaces,
+ reason = "Only the main `implm` method should be accessible."
+)]
pub(super) enum Command {
/// Manipulate the download cache
Cache {
diff --git a/crates/yt/src/commands/stats/implm.rs b/crates/yt/src/commands/stats/implm.rs
index 3e5bc25..e7a0e80 100644
--- a/crates/yt/src/commands/stats/implm.rs
+++ b/crates/yt/src/commands/stats/implm.rs
@@ -18,19 +18,17 @@ use crate::{
use anyhow::Result;
macro_rules! sort_by_operation {
- ($opts:expr, $operation:path) => {
- {
- let mut new = Vec::with_capacity($opts.inner().len());
+ ($opts:expr, $operation:path) => {{
+ let mut new = Vec::with_capacity($opts.inner().len());
- for (ts, op) in $opts.inner() {
- if matches!(op, $operation { .. }) {
- new.push((ts, op));
- }
+ for (ts, op) in $opts.inner() {
+ if matches!(op, $operation { .. }) {
+ new.push((ts, op));
}
-
- new
}
- }
+
+ new
+ }};
}
impl StatsCommand {
diff --git a/crates/yt_dlp/src/hooks.rs b/crates/yt_dlp/src/hooks.rs
index 4fc802b..343fd3f 100644
--- a/crates/yt_dlp/src/hooks.rs
+++ b/crates/yt_dlp/src/hooks.rs
@@ -58,6 +58,6 @@ macro_rules! wrap_hook {
}
pub mod __priv {
- pub use crate::info_json::{json_dumps, json_loads, filter_dict};
+ pub use crate::info_json::{filter_dict, json_dumps, json_loads};
pub use pyo3;
}
diff --git a/crates/yt_dlp/src/info_json.rs b/crates/yt_dlp/src/info_json.rs
index b19056d..b4c0d60 100644
--- a/crates/yt_dlp/src/info_json.rs
+++ b/crates/yt_dlp/src/info_json.rs
@@ -35,7 +35,9 @@ pub fn json_loads_any(input: serde_json::Value, py: Python<'_>) -> Bound<'_, PyA
#[must_use]
pub fn json_dumps_any(input: Bound<'_, PyAny>, py: Python<'_>) -> serde_json::Value {
let tmp_dict = PyDict::new(py);
- tmp_dict.set_item("tmp", input).expect("This should never throw an exception");
+ tmp_dict
+ .set_item("tmp", input)
+ .expect("This should never throw an exception");
let mut out = json_dumps(&tmp_dict);
out.remove("tmp").expect("was just assigned")