diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-25 17:30:02 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-25 17:30:02 +0200 |
commit | a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411 (patch) | |
tree | 24dc96e5384cf9309ae4ec00d6d91497e3253484 /src/subscribe/mod.rs | |
parent | docs(yt_dlp/progress_hook): Add a note about the possibility to calculate vid... (diff) | |
download | yt-a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411.tar.gz yt-a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411.zip |
refactor(treewide): Conform to `cargo clippy`
Diffstat (limited to '')
-rw-r--r-- | src/subscribe/mod.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/subscribe/mod.rs b/src/subscribe/mod.rs index 1cb3092..74d88b4 100644 --- a/src/subscribe/mod.rs +++ b/src/subscribe/mod.rs @@ -27,10 +27,10 @@ use crate::{ }; pub async fn unsubscribe(app: &App, name: String) -> Result<()> { - let present_subscriptions = get_subscriptions(&app).await?; + let present_subscriptions = get_subscriptions(app).await?; if let Some(subscription) = present_subscriptions.0.get(&name) { - remove_subscription(&app, subscription).await?; + remove_subscription(app, subscription).await?; } else { bail!("Couldn't find subscription: '{}'", &name); } @@ -44,7 +44,7 @@ pub async fn import<W: AsyncBufRead + AsyncBufReadExt + Unpin>( force: bool, ) -> Result<()> { if force { - remove_all_subscriptions(&app).await?; + remove_all_subscriptions(app).await?; } let mut lines = reader.lines(); @@ -59,7 +59,7 @@ pub async fn import<W: AsyncBufRead + AsyncBufReadExt + Unpin>( Err(err) => eprintln!( "Error while subscribing to '{}': '{}'", line, - err.source().expect("Should have a source").to_string() + err.source().expect("Should have a source") ), } } @@ -84,7 +84,7 @@ pub async fn subscribe(app: &App, name: Option<String>, url: Url) -> Result<()> if let Some(name) = name { let out: Result<()> = async move { actual_subscribe( - &app, + app, Some(name.clone() + " {Videos}"), url.join("videos/").expect("Works"), ) @@ -94,7 +94,7 @@ pub async fn subscribe(app: &App, name: Option<String>, url: Url) -> Result<()> })?; actual_subscribe( - &app, + app, Some(name.clone() + " {Streams}"), url.join("streams/").expect("Works"), ) @@ -104,7 +104,7 @@ pub async fn subscribe(app: &App, name: Option<String>, url: Url) -> Result<()> })?; actual_subscribe( - &app, + app, Some(name.clone() + " {Shorts}"), url.join("shorts/").expect("Works"), ) @@ -118,20 +118,20 @@ pub async fn subscribe(app: &App, name: Option<String>, url: Url) -> Result<()> out? } else { - actual_subscribe(&app, None, url.join("videos/").expect("Works")) + actual_subscribe(app, None, url.join("videos/").expect("Works")) .await .with_context(|| format!("Failed to subscribe to the '{}' variant", "{Videos}"))?; - actual_subscribe(&app, None, url.join("streams/").expect("Works")) + actual_subscribe(app, None, url.join("streams/").expect("Works")) .await .with_context(|| format!("Failed to subscribe to the '{}' variant", "{Streams}"))?; - actual_subscribe(&app, None, url.join("shorts/").expect("Works")) + actual_subscribe(app, None, url.join("shorts/").expect("Works")) .await .with_context(|| format!("Failed to subscribe to the '{}' variant", "{Shorts}"))?; } } else { - actual_subscribe(&app, name, url).await?; + actual_subscribe(app, name, url).await?; } Ok(()) @@ -164,7 +164,7 @@ async fn actual_subscribe(app: &App, name: Option<String>, url: Url) -> Result<( } }; - let present_subscriptions = get_subscriptions(&app).await?; + let present_subscriptions = get_subscriptions(app).await?; if let Some(subs) = present_subscriptions.0.get(&name) { bail!( @@ -178,7 +178,7 @@ async fn actual_subscribe(app: &App, name: Option<String>, url: Url) -> Result<( let sub = Subscription { name, url }; - add_subscription(&app, &sub).await?; + add_subscription(app, &sub).await?; Ok(()) } |