mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
prefetch-npm-deps: make cargo happy
This commit is contained in:
parent
ba656ad84e
commit
81ed58b0fe
@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
use sha1::Sha1;
|
use sha1::Sha1;
|
||||||
use sha2::{Sha256, Sha512};
|
use sha2::{Sha256, Sha512};
|
||||||
use std::{
|
use std::{
|
||||||
|
fmt::Write as FmtWrite,
|
||||||
fs::{self, File},
|
fs::{self, File},
|
||||||
io::Write,
|
io::Write,
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
@ -78,10 +79,10 @@ impl Cache {
|
|||||||
|
|
||||||
push_hash_segments(
|
push_hash_segments(
|
||||||
&mut p,
|
&mut p,
|
||||||
&hash
|
&hash.into_iter().fold(String::new(), |mut out, n| {
|
||||||
.into_iter()
|
let _ = write!(out, "{n:02x}");
|
||||||
.map(|n| format!("{n:02x}"))
|
out
|
||||||
.collect::<String>(),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
p
|
p
|
||||||
|
@ -182,6 +182,7 @@ impl fmt::Display for Hash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)]
|
||||||
impl PartialOrd for Hash {
|
impl PartialOrd for Hash {
|
||||||
fn partial_cmp(&self, other: &Hash) -> Option<Ordering> {
|
fn partial_cmp(&self, other: &Hash) -> Option<Ordering> {
|
||||||
let lhs = self.0.split_once('-')?.0;
|
let lhs = self.0.split_once('-')?.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user