diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2022-11-17 12:10:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 12:10:36 -0500 |
commit | f52b66a844d4bc790f62307b5c82e413c7b1e0c4 (patch) | |
tree | a9c6217f40e7592ba7c76e4dc4fb604f219db6ad /src/utils/gen_util.rs | |
parent | a07fa305fbb8898029fe009698fea838269ed6dd (diff) |
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
Diffstat (limited to 'src/utils/gen_util.rs')
-rw-r--r-- | src/utils/gen_util.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<usize>>(content: &str, width: U) -> Text<'a> { } #[inline] -pub fn sort_partial_fn<T: std::cmp::PartialOrd>(is_descending: bool) -> fn(T, T) -> Ordering { +pub const fn sort_partial_fn<T: std::cmp::PartialOrd>(is_descending: bool) -> fn(T, T) -> Ordering { if is_descending { partial_ordering_desc } else { |