diff options
Diffstat (limited to 'fatcat-cli/src/download.rs')
-rw-r--r-- | fatcat-cli/src/download.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fatcat-cli/src/download.rs b/fatcat-cli/src/download.rs index 44a11b7..d8a6f8c 100644 --- a/fatcat-cli/src/download.rs +++ b/fatcat-cli/src/download.rs @@ -102,7 +102,7 @@ fn rewrite_wayback_url(mut url: Url) -> Result<Url> { Ok(url) } -fn default_filename(specifier: &Specifier, fe: &FileEntity) -> Result<PathBuf> { +fn default_filename(specifier: &Specifier, fe: &FileEntity) -> PathBuf { let file_suffix = match fe.mimetype.as_deref() { Some("application/pdf") => ".pdf", Some("application/postscript") => ".ps", @@ -115,7 +115,7 @@ fn default_filename(specifier: &Specifier, fe: &FileEntity) -> Result<PathBuf> { }; let path_string = format!("{}{}", specifier, file_suffix); - Ok(PathBuf::from(&path_string)) + PathBuf::from(&path_string) } /// Attempts to download a file entity, including verifying checksum. @@ -137,11 +137,11 @@ pub fn download_file( let final_path = match output_path { Some(ref path) if path.is_dir() => { let mut full = output_path.unwrap_or_default(); - full.push(default_filename(specifier, fe)?); + full.push(default_filename(specifier, fe)); full } Some(path) => path, - None => default_filename(specifier, fe)?, + None => default_filename(specifier, fe), }; // NOTE: this isn't perfect; there could have been a race condition |