From 81ed58b0fef21985242dea442e398b3bb81c9d67 Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Tue, 21 Nov 2023 18:18:26 -0500 Subject: [PATCH] prefetch-npm-deps: make cargo happy --- pkgs/build-support/node/fetch-npm-deps/src/cacache.rs | 9 +++++---- pkgs/build-support/node/fetch-npm-deps/src/parse/lock.rs | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/node/fetch-npm-deps/src/cacache.rs b/pkgs/build-support/node/fetch-npm-deps/src/cacache.rs index 75133b1b03ea..c49c094b85c6 100644 --- a/pkgs/build-support/node/fetch-npm-deps/src/cacache.rs +++ b/pkgs/build-support/node/fetch-npm-deps/src/cacache.rs @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize}; use sha1::Sha1; use sha2::{Sha256, Sha512}; use std::{ + fmt::Write as FmtWrite, fs::{self, File}, io::Write, path::PathBuf, @@ -78,10 +79,10 @@ impl Cache { push_hash_segments( &mut p, - &hash - .into_iter() - .map(|n| format!("{n:02x}")) - .collect::(), + &hash.into_iter().fold(String::new(), |mut out, n| { + let _ = write!(out, "{n:02x}"); + out + }), ); p diff --git a/pkgs/build-support/node/fetch-npm-deps/src/parse/lock.rs b/pkgs/build-support/node/fetch-npm-deps/src/parse/lock.rs index f50a31651d0e..f7273d6a7888 100644 --- a/pkgs/build-support/node/fetch-npm-deps/src/parse/lock.rs +++ b/pkgs/build-support/node/fetch-npm-deps/src/parse/lock.rs @@ -182,6 +182,7 @@ impl fmt::Display for Hash { } } +#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)] impl PartialOrd for Hash { fn partial_cmp(&self, other: &Hash) -> Option { let lhs = self.0.split_once('-')?.0;