diff options
| author | Naz <ndpm13@ch-naseem.com> | 2025-07-31 15:59:56 +0100 |
|---|---|---|
| committer | Naz <ndpm13@ch-naseem.com> | 2025-07-31 15:59:56 +0100 |
| commit | 180fe06facf1f8b4796df69a42596643990b9d32 (patch) | |
| tree | e4fc09be4c29c01a1f62e988a19e99d1c3a7a85e /src/downloader.rs | |
| parent | 030eef4c9b4f82fe16ddd019c436e7065758d3dc (diff) | |
✨feat: remove expect from path module
Diffstat (limited to 'src/downloader.rs')
| -rw-r--r-- | src/downloader.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/downloader.rs b/src/downloader.rs index be35bd8..cf78a49 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -11,17 +11,17 @@ impl Downloader { pub fn new() -> Self { Self {} } - pub fn prepare_path(&self, url: &str, executable: &str) -> PathBuf { + pub fn prepare_path(&self, url: &str, executable: &str) -> Result<PathBuf> { // Try to extract filename from URL or use default let filename = match url.split('/').next_back() { Some(name) => name.to_string(), None => format!("{executable}.AppImage"), }; - appimages_dir().join(filename) + Ok(appimages_dir()?.join(filename)) } pub async fn download_with_progress(&self, url: &str, path: &PathBuf) -> Result<()> { - fs::create_dir_all(&appimages_dir()).await?; + fs::create_dir_all(&appimages_dir()?).await?; let resp = reqwest::get(&url.to_string()).await?; let total_size = resp.content_length().unwrap_or(0); |
