mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
style(clippy): Make the event graph generic over the hasher
This commit is contained in:
@@ -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> {
|
||||||
|
|||||||
Reference in New Issue
Block a user