From d54acba81fbf80da7d8de8fa34e45d609f56eb4a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 16 Jan 2021 19:29:19 +1000 Subject: [PATCH] custom ord/partialeq is not required; fix clippy lint --- rslib/src/tags.rs | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/rslib/src/tags.rs b/rslib/src/tags.rs index 2a0355f14..f01fabcbf 100644 --- a/rslib/src/tags.rs +++ b/rslib/src/tags.rs @@ -11,37 +11,16 @@ use crate::{ }; use regex::{NoExpand, Regex, Replacer}; -use std::cmp::Ordering; use std::{borrow::Cow, collections::HashSet, iter::Peekable}; use unicase::UniCase; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Tag { pub name: String, pub usn: Usn, pub collapsed: bool, } -impl Ord for Tag { - fn cmp(&self, other: &Self) -> Ordering { - UniCase::new(&self.name).cmp(&UniCase::new(&other.name)) - } -} - -impl PartialOrd for Tag { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } -} - -impl PartialEq for Tag { - fn eq(&self, other: &Self) -> bool { - self.cmp(other) == Ordering::Equal - } -} - -impl Eq for Tag {} - impl From for TagProto { fn from(t: Tag) -> Self { TagProto { @@ -132,7 +111,7 @@ fn add_self_and_missing_parents<'a, 'b>( ) { if let Some(parent) = immediate_parent_name(tag_name) { if !all.contains(&parent) { - missing.push(parent.clone()); + missing.push(parent); add_self_and_missing_parents(all, missing, parent); } }