Fix unused import clippy warning

This commit is contained in:
Devin Ragotzy 2021-02-03 23:01:31 -05:00
parent 48601142f8
commit 8f283510aa
4 changed files with 46 additions and 18 deletions

View file

@ -21,9 +21,9 @@ use ruma::{
serde::{to_canonical_value, CanonicalJsonObject, Raw},
EventId, RoomId, RoomVersionId, ServerName, UserId,
};
use state_res::Event;
// use state_res::Event;
use std::{
collections::{BTreeMap, HashMap, HashSet},
collections::{BTreeMap, HashSet},
convert::TryFrom,
iter,
sync::Arc,
@ -557,7 +557,7 @@ async fn join_room_by_id_helper(
let room_state = send_join_response.room_state.state.iter().map(add_event_id);
let state_events = room_state
let _state_events = room_state
.clone()
.map(|pdu: Result<(EventId, CanonicalJsonObject)>| Ok(pdu?.0))
.chain(iter::once(Ok(event_id.clone()))) // Add join event we just created

View file

@ -117,8 +117,7 @@ pub async fn login_route(
let device_exists = body.device_id.as_ref().map_or(false, |device_id| {
db.users
.all_device_ids(&user_id)
.find(|x| x.as_ref().map_or(false, |v| v == device_id))
.is_some()
.any(|x| x.as_ref().map_or(false, |v| v == device_id))
});
if device_exists {

View file

@ -800,8 +800,7 @@ pub async fn send_transaction_message_route<'a>(
}
};
// Make this the state after (since we appended_incoming_pdu this should agree with our servers
// current state).
// Make this the state after.
let mut state_after = state_at_event.clone();
state_after.insert((pdu.kind(), pdu.state_key()), pdu.clone());
// Add the incoming event to the mix of state snapshots