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

52
Cargo.lock generated
View file

@ -97,6 +97,12 @@ version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b"
[[package]]
name = "base64"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
[[package]]
name = "base64"
version = "0.13.0"
@ -172,7 +178,7 @@ dependencies = [
"num-integer",
"num-traits",
"time 0.1.43",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -185,7 +191,7 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
name = "conduit"
version = "0.1.0"
dependencies = [
"base64",
"base64 0.13.0",
"directories",
"http",
"image",
@ -227,7 +233,7 @@ version = "0.15.0-dev"
source = "git+https://github.com/SergioBenitez/cookie-rs.git?rev=1c3ca83#1c3ca838543b60a4448d279dc4b903cc7a2bc22a"
dependencies = [
"percent-encoding",
"time 0.2.24",
"time 0.2.25",
"version_check",
]
@ -871,6 +877,20 @@ dependencies = [
"serde",
]
[[package]]
name = "jsonwebtoken"
version = "7.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afabcc15e437a6484fc4f12d0fd63068fe457bf93f1c148d3d9649c60b103f32"
dependencies = [
"base64 0.12.3",
"pem",
"ring",
"serde",
"serde_json",
"simple_asn1",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
@ -1509,7 +1529,7 @@ version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd281b1030aa675fb90aa994d07187645bb3c8fc756ca766e7c3070b439de9de"
dependencies = [
"base64",
"base64 0.13.0",
"bytes",
"encoding_rs",
"futures-core",
@ -1584,8 +1604,8 @@ dependencies = [
"rocket_http",
"serde",
"state",
"time 0.2.24",
"tokio 1.0.2",
"time 0.2.25",
"tokio",
"ubyte",
"version_check",
"yansi",
@ -1622,8 +1642,8 @@ dependencies = [
"ref-cast",
"smallvec",
"state",
"time 0.2.24",
"tokio 1.0.2",
"time 0.2.25",
"tokio",
"tokio-rustls",
"uncased",
"unicode-xid",
@ -1819,7 +1839,7 @@ name = "ruma-signatures"
version = "0.6.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=bba442580d6cd7ed990b2b63387eed2238cbadc8#bba442580d6cd7ed990b2b63387eed2238cbadc8"
dependencies = [
"base64",
"base64 0.13.0",
"ring",
"ruma-identifiers",
"ruma-serde",
@ -1833,7 +1853,7 @@ version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb"
dependencies = [
"base64",
"base64 0.13.0",
"blake2b_simd",
"constant_time_eq",
"crossbeam-utils",
@ -1854,7 +1874,7 @@ version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b"
dependencies = [
"base64",
"base64 0.13.0",
"log",
"ring",
"sct",
@ -2189,6 +2209,16 @@ dependencies = [
"once_cell",
]
[[package]]
name = "time"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "time"
version = "0.2.25"

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