From f52b66a844d4bc790f62307b5c82e413c7b1e0c4 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Thu, 17 Nov 2022 12:10:36 -0500 Subject: other: deduplicate sorts, always sort proc by PID first (#898) * other: deduplicate sorts, sort proc by PID by default * add proc test * remove sort in Windows * fix tree * fix test * Remove mut * Add comment on sorting processes --- src/utils/gen_util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/utils/gen_util.rs') diff --git a/src/utils/gen_util.rs b/src/utils/gen_util.rs index 2af9d1b0..3a482937 100644 --- a/src/utils/gen_util.rs +++ b/src/utils/gen_util.rs @@ -111,7 +111,7 @@ pub fn truncate_text<'a, U: Into>(content: &str, width: U) -> Text<'a> { } #[inline] -pub fn sort_partial_fn(is_descending: bool) -> fn(T, T) -> Ordering { +pub const fn sort_partial_fn(is_descending: bool) -> fn(T, T) -> Ordering { if is_descending { partial_ordering_desc } else { -- cgit v1.2.3