task: implement Ord for task::Id (#7530)

This commit is contained in:
Asger Hautop Drewsen
2025-08-15 09:52:12 +02:00
committed by GitHub
parent 23263231fd
commit dd74c7c1bf
+1 -1
View File
@@ -16,7 +16,7 @@ use std::{fmt, num::NonZeroU64};
/// [`task::id()`](crate::task::id()) functions and from outside the task via
/// the [`JoinHandle::id()`](crate::task::JoinHandle::id()) function.
#[cfg_attr(docsrs, doc(cfg(all(feature = "rt"))))]
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, PartialOrd, Ord)]
pub struct Id(pub(crate) NonZeroU64);
/// Returns the [`Id`] of the currently running task.