chore: get rid of warnings

This commit is contained in:
Timo Kösters 2021-03-18 18:33:43 +01:00
parent 7b3fe88345
commit f775c76d8a
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
11 changed files with 24 additions and 33 deletions

View file

@ -1 +1 @@
1.47.0
1.50.0

View file

@ -1 +1,2 @@
unstable_features = true
imports_granularity="Crate"

View file

@ -3,9 +3,7 @@ use crate::{ConduitResult, Database, Error, Ruma};
use ruma::{
api::client::{
error::ErrorKind,
r0::{
capabilities::get_capabilities, read_marker::set_read_marker, receipt::create_receipt,
},
r0::{read_marker::set_read_marker, receipt::create_receipt},
},
events::{AnyEphemeralRoomEvent, AnyEvent, EventType},
};

View file

@ -559,7 +559,7 @@ pub async fn sync_events_route(
let pdus = db.rooms.pdus_since(&sender_user, &room_id, since)?;
let mut room_events = pdus
.filter_map(|pdu| pdu.ok()) // Filter out buggy events
.take_while(|(pdu_id, pdu)| &since_member.0 != pdu)
.take_while(|(_, pdu)| &since_member.0 != pdu)
.map(|(_, pdu)| pdu.to_sync_room_event())
.collect::<Vec<_>>();
room_events.push(since_member.0.to_sync_room_event());

View file

@ -9,17 +9,19 @@ use ruma::{
},
OutgoingRequest,
},
events::room::{
events::{
room::{
member::{MemberEventContent, MembershipState},
message::{MessageEventContent, MessageType, TextMessageEventContent},
power_levels::PowerLevelsEventContent,
},
events::EventType,
EventType,
},
push::{Action, PushCondition, PushFormat, Ruleset, Tweak},
uint, UInt, UserId,
};
use std::{convert::TryFrom, fmt::Debug, time::Duration};
use std::{convert::TryFrom, fmt::Debug};
#[derive(Debug, Clone)]
pub struct PushData {

View file

@ -3,7 +3,7 @@ mod edus;
pub use edus::RoomEdus;
use crate::{pdu::PduBuilder, utils, Database, Error, PduEvent, Result};
use log::{debug, error, info, warn};
use log::{error, warn};
use regex::Regex;
use ring::digest;
use ruma::{

View file

@ -10,7 +10,7 @@ use crate::{
appservice_server, database::pusher, server_server, utils, Database, Error, PduEvent, Result,
};
use federation::transactions::send_transaction_message;
use log::{debug, error, info, warn};
use log::{error, info, warn};
use ring::digest;
use rocket::futures::stream::{FuturesUnordered, StreamExt};
use ruma::{

View file

@ -1,18 +1,7 @@
use std::{
collections::HashMap,
sync::RwLock,
time::{Duration, Instant},
};
use log::error;
use ruma::{
api::client::{error::ErrorKind, r0::uiaa::UiaaInfo},
events::room::message,
};
use ruma::api::client::{error::ErrorKind, r0::uiaa::UiaaInfo};
use thiserror::Error;
use crate::{database::admin::AdminCommand, Database};
#[cfg(feature = "conduit_bin")]
use {
crate::RumaResponse,

View file

@ -19,7 +19,6 @@ pub use rocket::State;
use ruma::api::client::error::ErrorKind;
pub use ruma_wrapper::{ConduitResult, Ruma, RumaResponse};
use log::LevelFilter;
use rocket::{
catch, catchers,
fairing::AdHoc,

View file

@ -1,13 +1,10 @@
use crate::Error;
use ruma::{
api::{AuthScheme, IncomingRequest, OutgoingRequest},
api::OutgoingRequest,
identifiers::{DeviceId, UserId},
Outgoing,
};
use std::{
convert::{TryFrom, TryInto},
ops::Deref,
};
use std::{convert::TryInto, ops::Deref};
#[cfg(feature = "conduit_bin")]
use {
@ -24,6 +21,8 @@ use {
tokio::io::AsyncReadExt,
Request, State,
},
ruma::api::{AuthScheme, IncomingRequest},
std::convert::TryFrom,
std::io::Cursor,
};

View file

@ -3,7 +3,7 @@ use get_profile_information::v1::ProfileField;
use http::header::{HeaderValue, AUTHORIZATION, HOST};
use log::{debug, error, info, warn};
use regex::Regex;
use rocket::{get, post, put, response::content::Json, State};
use rocket::{response::content::Json, State};
use ruma::{
api::{
client::error::ErrorKind,
@ -28,7 +28,7 @@ use ruma::{
use state_res::{Event, EventMap, StateMap};
use std::{
collections::{BTreeMap, BTreeSet, HashMap},
convert::{TryFrom, TryInto},
convert::TryFrom,
fmt::Debug,
future::Future,
net::{IpAddr, SocketAddr},
@ -38,6 +38,9 @@ use std::{
time::{Duration, SystemTime},
};
#[cfg(feature = "conduit_bin")]
use rocket::{get, post, put};
#[tracing::instrument(skip(globals))]
pub async fn send_request<T: OutgoingRequest>(
globals: &crate::database::globals::Globals,