diff --git a/crates/ruma-state-res/benches/state_res_bench.rs b/crates/ruma-state-res/benches/state_res_bench.rs index 6b9dde19..f279a100 100644 --- a/crates/ruma-state-res/benches/state_res_bench.rs +++ b/crates/ruma-state-res/benches/state_res_bench.rs @@ -63,7 +63,6 @@ fn resolution_shallow_auth_chain(c: &mut Criterion) { let ev_map: EventMap> = store.0.clone(); let state_sets = vec![state_at_bob.clone(), state_at_charlie.clone()]; let _ = match state_res::resolve::( - &room_id(), &RoomVersionId::Version6, &state_sets, state_sets @@ -120,7 +119,6 @@ fn resolve_deeper_event_set(c: &mut Criterion) { b.iter(|| { let state_sets = vec![state_set_a.clone(), state_set_b.clone()]; let _ = match state_res::resolve::( - &room_id(), &RoomVersionId::Version6, &state_sets, state_sets diff --git a/crates/ruma-state-res/src/lib.rs b/crates/ruma-state-res/src/lib.rs index 781c3ee5..1e7b9a41 100644 --- a/crates/ruma-state-res/src/lib.rs +++ b/crates/ruma-state-res/src/lib.rs @@ -13,7 +13,7 @@ use ruma_events::{ }, EventType, }; -use ruma_identifiers::{EventId, RoomId, RoomVersionId}; +use ruma_identifiers::{EventId, RoomVersionId}; use tracing::{debug, info, trace, warn}; mod error; @@ -53,7 +53,6 @@ pub type EventMap = HashMap; /// The caller of `resolve` must ensure that all the events are from the same room. Although this /// function takes a `RoomId` it does not check that each event is part of the same room. pub fn resolve( - room_id: &RoomId, room_version: &RoomVersionId, state_sets: &[StateMap], auth_chain_sets: Vec>, @@ -80,7 +79,7 @@ where debug!("{:?}", conflicting); // The set of auth events that are not common across server forks - let mut auth_diff = get_auth_chain_diff(room_id, auth_chain_sets)?; + let mut auth_diff = get_auth_chain_diff(auth_chain_sets)?; // Add the auth_diff to conflicting now we have a full set of conflicting events auth_diff.extend(conflicting.values().cloned().flatten().flatten()); @@ -196,10 +195,7 @@ pub fn separate( } /// Returns a Vec of deduped EventIds that appear in some chains but not others. -pub fn get_auth_chain_diff( - _room_id: &RoomId, - auth_chain_sets: Vec>, -) -> Result> { +pub fn get_auth_chain_diff(auth_chain_sets: Vec>) -> Result> { if let Some(first) = auth_chain_sets.first().cloned() { let common = auth_chain_sets .iter() diff --git a/crates/ruma-state-res/src/test_utils.rs b/crates/ruma-state-res/src/test_utils.rs index 70731ad2..fc50bdf3 100644 --- a/crates/ruma-state-res/src/test_utils.rs +++ b/crates/ruma-state-res/src/test_utils.rs @@ -109,7 +109,6 @@ pub fn do_check( ); let resolved = state_res::resolve( - &room_id(), &RoomVersionId::Version6, &state_sets, state_sets diff --git a/crates/ruma-state-res/tests/res_with_auth_ids.rs b/crates/ruma-state-res/tests/res_with_auth_ids.rs index 5f753a0e..dab48f1f 100644 --- a/crates/ruma-state-res/tests/res_with_auth_ids.rs +++ b/crates/ruma-state-res/tests/res_with_auth_ids.rs @@ -69,7 +69,6 @@ fn ban_with_auth_chains2() { let ev_map: EventMap> = store.0.clone(); let state_sets = vec![state_set_a, state_set_b]; let resolved = match state_res::resolve::( - &room_id(), &RoomVersionId::Version6, &state_sets, state_sets diff --git a/crates/ruma-state-res/tests/state_res.rs b/crates/ruma-state-res/tests/state_res.rs index ddaf3077..634e0032 100644 --- a/crates/ruma-state-res/tests/state_res.rs +++ b/crates/ruma-state-res/tests/state_res.rs @@ -262,7 +262,6 @@ fn test_event_map_none() { let ev_map: EventMap> = store.0.clone(); let state_sets = vec![state_at_bob, state_at_charlie]; let resolved = match state_res::resolve::( - &room_id(), &RoomVersionId::Version2, &state_sets, state_sets