From e563cb3b2f15c54a252a91b2b704fd7302aaddea Mon Sep 17 00:00:00 2001 From: daladim Date: Thu, 12 Aug 2021 20:05:58 +0200 Subject: [PATCH] Comparison functions are no longer provided --- src/utils/comparison.rs | 10 ---------- src/utils/mod.rs | 2 -- 2 files changed, 12 deletions(-) delete mode 100644 src/utils/comparison.rs diff --git a/src/utils/comparison.rs b/src/utils/comparison.rs deleted file mode 100644 index db0095b..0000000 --- a/src/utils/comparison.rs +++ /dev/null @@ -1,10 +0,0 @@ -//! Utilities to compare custom types -//! -//! These can be used to sort results, e.g. by using `sorted_by` from the `itertools` crate - -use crate::item::{Item, ItemId}; - -/// Compare alphabetically types returned e.g. by [`crate::traits::CompleteCalendar::get_items`] -pub fn compare_items_alpha(left: &(&ItemId, &&Item), right: &(&ItemId, &&Item)) -> std::cmp::Ordering { - Ord::cmp(&left.1.name().to_lowercase(), &right.1.name().to_lowercase()) -} diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 82519e2..9aba3a5 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -13,8 +13,6 @@ use crate::calendar::CalendarId; use crate::Item; use crate::item::SyncStatus; -pub mod comparison; - /// Walks an XML tree and returns every element that has the given name pub fn find_elems>(root: &Element, searched_name: S) -> Vec<&Element> { let searched_name = searched_name.as_ref();