diff --git a/src/deb/ephemeral.rs b/src/deb/ephemeral.rs index 2efe84b..a80ad59 100644 --- a/src/deb/ephemeral.rs +++ b/src/deb/ephemeral.rs @@ -336,7 +336,7 @@ impl EphemeralContextGuard { impl Drop for EphemeralContextGuard { fn drop(&mut self) { - log::debug!("Cleaning up ephemeral context ({:?})...", &self.chroot_path); + log::debug!("Cleaning up ephemeral context ({:?})...", self.chroot_path); // Reset to normal context if let Err(e) = context::manager().set_current(&self.previous_context) { log::error!("Failed to restore context {}: {}", self.previous_context, e); diff --git a/src/distro_info.rs b/src/distro_info.rs index 7663c35..75ef95f 100644 --- a/src/distro_info.rs +++ b/src/distro_info.rs @@ -181,7 +181,7 @@ pub async fn get_n_latest_released_series( } // Sort by release date descending (newest first) - released_series.sort_by(|a, b| b.release.cmp(&a.release)); + released_series.sort_by_key(|b| std::cmp::Reverse(b.release)); Ok(released_series .iter() diff --git a/src/pull.rs b/src/pull.rs index d2bd3c7..932f5aa 100644 --- a/src/pull.rs +++ b/src/pull.rs @@ -227,12 +227,12 @@ async fn download_file_checksum( // Download with reqwest let response = reqwest::get(url).await?; if !response.status().is_success() { - return Err(format!("Failed to download '{}' : {}", &url, response.status()).into()); + return Err(format!("Failed to download '{}' : {}", url, response.status()).into()); } let total_size = response .content_length() - .ok_or(format!("Failed to get content length from '{}'", &url))?; + .ok_or(format!("Failed to get content length from '{}'", url))?; let mut index = 0; // Target file: extract file name from URL @@ -342,7 +342,7 @@ async fn fetch_orig_tarball( // or the current directory if cwd is None (which effectively is the parent of the package dir) let target_dir = cwd.unwrap_or_else(|| Path::new(".")); download_file_checksum( - format!("{}/{}", &info.archive_url, filename).as_str(), + format!("{}/{}", info.archive_url, filename).as_str(), &orig_file.sha256, target_dir, progress, @@ -372,7 +372,7 @@ async fn fetch_dsc_file( debug!("Fetching dsc file: {}", filename); download_file_checksum( - format!("{}/{}", &info.archive_url, filename).as_str(), + format!("{}/{}", info.archive_url, filename).as_str(), &dsc_file.sha256, target_dir, progress,