From aa9540af21d7533f39a8b6d44705f79e7e45935f Mon Sep 17 00:00:00 2001 From: strawberry Date: Wed, 10 Jul 2024 19:56:34 -0400 Subject: [PATCH] slightly simplify send_state_event route Signed-off-by: strawberry --- src/api/client/state.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/api/client/state.rs b/src/api/client/state.rs index 9247b123..c63ddba5 100644 --- a/src/api/client/state.rs +++ b/src/api/client/state.rs @@ -36,18 +36,16 @@ pub(crate) async fn send_state_event_for_key_route( ) -> Result { let sender_user = body.sender_user.as_ref().expect("user is authenticated"); - let event_id = send_state_event_for_key_helper( - sender_user, - &body.room_id, - &body.event_type, - &body.body.body, - body.state_key.clone(), - ) - .await?; - - let event_id = (*event_id).to_owned(); Ok(send_state_event::v3::Response { - event_id, + event_id: send_state_event_for_key_helper( + sender_user, + &body.room_id, + &body.event_type, + &body.body.body, + body.state_key.clone(), + ) + .await? + .into(), }) }