mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 13:08:42 +00:00
Impl PartialEq
, Eq
and Hash
fo MetaData
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
2f27a5fd93
commit
4114b6e7c4
1 changed files with 16 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
use std::{
|
||||
fs,
|
||||
fs, hash,
|
||||
io::{self, Write},
|
||||
iter::IntoIterator,
|
||||
path::{Path, PathBuf},
|
||||
|
@ -23,6 +23,21 @@ pub struct MetaData {
|
|||
pub target: CompactString,
|
||||
pub bins: Vec<CompactString>,
|
||||
}
|
||||
impl PartialEq for MetaData {
|
||||
fn eq(&self, other: &MetaData) -> bool {
|
||||
self.name == other.name
|
||||
}
|
||||
}
|
||||
impl Eq for MetaData {}
|
||||
|
||||
impl hash::Hash for MetaData {
|
||||
fn hash<H>(&self, state: &mut H)
|
||||
where
|
||||
H: hash::Hasher,
|
||||
{
|
||||
self.name.hash(state)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
|
||||
pub enum SourceType {
|
||||
|
|
Loading…
Add table
Reference in a new issue