mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
style: Use debug assert instead of a normal assert
This commit is contained in:
1 parent
8575f191a0
commit
0924b7d27e
1 file changed
+7
-4
@@ -9,7 +9,8 @@ use axum_client_ip::ClientIp;
|
|||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
debug, debug_warn, err, error, result::LogErr, state_res::lexicographical_topological_sort, trace,
|
debug, debug_warn, err, error, result::LogErr, state_res::lexicographical_topological_sort, trace,
|
||||||
utils::{
|
utils::{
|
||||||
millis_since_unix_epoch, stream::{automatic_width, BroadbandExt, TryBroadbandExt}, IterStream, ReadyExt,
|
millis_since_unix_epoch, stream::{automatic_width, BroadbandExt, TryBroadbandExt}, IterStream,
|
||||||
|
ReadyExt,
|
||||||
},
|
},
|
||||||
warn,
|
warn,
|
||||||
Err,
|
Err,
|
||||||
@@ -309,7 +310,7 @@ async fn build_local_dag(
|
|||||||
id_origin_ts.insert(event_id.clone(), origin_server_ts);
|
id_origin_ts.insert(event_id.clone(), origin_server_ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!(count=dag.len(), "Sorting incoming events with partial graph");
|
debug!(count = dag.len(), "Sorting incoming events with partial graph");
|
||||||
lexicographical_topological_sort(&dag, &async |node_id| {
|
lexicographical_topological_sort(&dag, &async |node_id| {
|
||||||
// Note: we don't bother fetching power levels because that would massively slow
|
// Note: we don't bother fetching power levels because that would massively slow
|
||||||
// this function down. This is a best-effort attempt to order events correctly
|
// this function down. This is a best-effort attempt to order events correctly
|
||||||
@@ -326,11 +327,13 @@ async fn build_local_dag(
|
|||||||
Ok((int!(0), MilliSecondsSinceUnixEpoch(ts)))
|
Ok((int!(0), MilliSecondsSinceUnixEpoch(ts)))
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.inspect(|sorted| assert_eq!(
|
.inspect(|sorted| {
|
||||||
|
debug_assert_eq!(
|
||||||
sorted.len(),
|
sorted.len(),
|
||||||
pdu_map.len(),
|
pdu_map.len(),
|
||||||
"Sorted graph was not the same size as the input graph"
|
"Sorted graph was not the same size as the input graph"
|
||||||
))
|
);
|
||||||
|
})
|
||||||
.map_err(|e| err!("failed to resolve local graph: {e}"))
|
.map_err(|e| err!("failed to resolve local graph: {e}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user