From 6642978a0fb63a992e3a79a1f6987b44fed67f78 Mon Sep 17 00:00:00 2001 From: lov3b Date: Mon, 6 Mar 2023 07:52:40 +0100 Subject: [PATCH] type Error --- src/playlist.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/playlist.rs b/src/playlist.rs index 4fa04bb..41f3c28 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -2,6 +2,8 @@ use std::{fs, ops::Deref, path::PathBuf, rc::Rc}; use crate::{download_with_progress, MAX_TRIES}; +type Error = String; + pub struct Playlist { pub content: String, path_to_playlist: Rc, @@ -48,7 +50,7 @@ impl Playlist { ) } - pub async fn get_saved_or_download(&self) -> Result { + pub async fn get_saved_or_download(&self) -> Result { let content = if let Some(content) = self.get_saved() { content } else { @@ -66,7 +68,7 @@ impl Playlist { Ok(content) } - pub async fn download(&self) -> Result { + pub async fn download(&self) -> Result { let mut counter: u8 = 0; loop { counter += 1;