Move state_res topological_sort out of resolve.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-02-14 04:31:24 +00:00
parent d904d30a16
commit 6cd4c1a70b
5 changed files with 6 additions and 6 deletions

View File

@@ -65,11 +65,13 @@ mod fetch_state;
mod resolve; mod resolve;
#[cfg(test)] #[cfg(test)]
mod test_utils; mod test_utils;
mod topological_sort;
use self::{event_auth::check_state_dependent_auth_rules, fetch_state::FetchStateExt}; use self::{event_auth::check_state_dependent_auth_rules, fetch_state::FetchStateExt};
pub use self::{ pub use self::{
event_auth::{AuthTypes, auth_check, auth_types_for_event}, event_auth::{AuthTypes, auth_check, auth_types_for_event},
event_format::check_pdu_format, event_format::check_pdu_format,
resolve::{AuthSet, ConflictMap, StateMap, resolve, topological_sort}, resolve::{AuthSet, ConflictMap, StateMap, resolve},
topological_sort::topological_sort,
}; };
use crate::matrix::TypeStateKey; use crate::matrix::TypeStateKey;

View File

@@ -7,7 +7,6 @@ mod iterative_auth_check;
mod mainline_sort; mod mainline_sort;
mod power_sort; mod power_sort;
mod split_conflicted; mod split_conflicted;
mod topological_sort;
use std::collections::{BTreeMap, BTreeSet, HashSet}; use std::collections::{BTreeMap, BTreeSet, HashSet};
@@ -15,7 +14,6 @@ use futures::{FutureExt, Stream, StreamExt, TryFutureExt};
use itertools::Itertools; use itertools::Itertools;
use ruma::{OwnedEventId, events::StateEventType, room_version_rules::RoomVersionRules}; use ruma::{OwnedEventId, events::StateEventType, room_version_rules::RoomVersionRules};
pub use self::topological_sort::topological_sort;
use self::{ use self::{
auth_difference::auth_difference, conflicted_subgraph::conflicted_subgraph_dfs, auth_difference::auth_difference, conflicted_subgraph::conflicted_subgraph_dfs,
iterative_auth_check::iterative_auth_check, mainline_sort::mainline_sort, iterative_auth_check::iterative_auth_check, mainline_sort::mainline_sort,

View File

@@ -10,8 +10,8 @@ use ruma::{
room_version_rules::RoomVersionRules, room_version_rules::RoomVersionRules,
}; };
use super::{ use super::super::{
super::events::{ events::{
RoomCreateEvent, RoomPowerLevelsEvent, RoomPowerLevelsIntField, is_power_event, RoomCreateEvent, RoomPowerLevelsEvent, RoomPowerLevelsIntField, is_power_event,
power_levels::RoomPowerLevelsEventOptionExt, power_levels::RoomPowerLevelsEventOptionExt,
}, },

View File

@@ -499,7 +499,7 @@ async fn test_reverse_topological_power_sort() {
event_id("p") => hashset![event_id("o")], event_id("p") => hashset![event_id("o")],
}; };
let res = super::topological_sort(&graph, &async |_id| { let res = super::super::topological_sort(&graph, &async |_id| {
Ok((int!(0).into(), MilliSecondsSinceUnixEpoch(uint!(0)))) Ok((int!(0).into(), MilliSecondsSinceUnixEpoch(uint!(0))))
}) })
.await .await