about summary refs log tree commit diff stats
path: root/src/subscribe/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/subscribe/mod.rs')
-rw-r--r--src/subscribe/mod.rs26
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(())
 }