mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-07 20:50:03 +00:00
Impl PartialOrd
and Ord
for MetaData
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
4114b6e7c4
commit
90203dd467
1 changed files with 14 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
use std::{
|
||||
fs, hash,
|
||||
cmp, fs, hash,
|
||||
io::{self, Write},
|
||||
iter::IntoIterator,
|
||||
path::{Path, PathBuf},
|
||||
|
@ -24,12 +24,24 @@ pub struct MetaData {
|
|||
pub bins: Vec<CompactString>,
|
||||
}
|
||||
impl PartialEq for MetaData {
|
||||
fn eq(&self, other: &MetaData) -> bool {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.name == other.name
|
||||
}
|
||||
}
|
||||
impl Eq for MetaData {}
|
||||
|
||||
impl PartialOrd for MetaData {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
|
||||
self.name.partial_cmp(&other.name)
|
||||
}
|
||||
}
|
||||
|
||||
impl Ord for MetaData {
|
||||
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
||||
self.name.cmp(&other.name)
|
||||
}
|
||||
}
|
||||
|
||||
impl hash::Hash for MetaData {
|
||||
fn hash<H>(&self, state: &mut H)
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue