style(clippy): Make the event graph generic over the hasher

This commit is contained in:
Jade Ellis
2025-11-10 19:41:56 +00:00
committed by Ellis Git
parent 45e4053883
commit 9e4bcda17b
+3 -2
View File
@@ -421,8 +421,8 @@ where
/// `key_fn` is used as to obtain the power level and age of an event for /// `key_fn` is used as to obtain the power level and age of an event for
/// breaking ties (together with the event ID). /// breaking ties (together with the event ID).
#[tracing::instrument(level = "debug", skip_all)] #[tracing::instrument(level = "debug", skip_all)]
pub async fn lexicographical_topological_sort<Id, F, Fut, Hasher>( pub async fn lexicographical_topological_sort<Id, F, Fut, Hasher, S>(
graph: &HashMap<Id, HashSet<Id, Hasher>>, graph: &HashMap<Id, HashSet<Id, Hasher>, S>,
key_fn: &F, key_fn: &F,
) -> Result<Vec<Id>> ) -> Result<Vec<Id>>
where where
@@ -430,6 +430,7 @@ where
Fut: Future<Output = Result<(Int, MilliSecondsSinceUnixEpoch)>> + Send, Fut: Future<Output = Result<(Int, MilliSecondsSinceUnixEpoch)>> + Send,
Id: Borrow<EventId> + Clone + Eq + Hash + Ord + Send + Sync, Id: Borrow<EventId> + Clone + Eq + Hash + Ord + Send + Sync,
Hasher: BuildHasher + Default + Clone + Send + Sync, Hasher: BuildHasher + Default + Clone + Send + Sync,
S: BuildHasher + Clone + Send + Sync,
{ {
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]
struct TieBreaker<'a, Id> { struct TieBreaker<'a, Id> {