chore: get rid of warnings

next
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" imports_granularity="Crate"

View File

@ -3,9 +3,7 @@ use crate::{ConduitResult, Database, Error, Ruma};
use ruma::{ use ruma::{
api::client::{ api::client::{
error::ErrorKind, error::ErrorKind,
r0::{ r0::{read_marker::set_read_marker, receipt::create_receipt},
capabilities::get_capabilities, read_marker::set_read_marker, receipt::create_receipt,
},
}, },
events::{AnyEphemeralRoomEvent, AnyEvent, EventType}, 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 pdus = db.rooms.pdus_since(&sender_user, &room_id, since)?;
let mut room_events = pdus let mut room_events = pdus
.filter_map(|pdu| pdu.ok()) // Filter out buggy events .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()) .map(|(_, pdu)| pdu.to_sync_room_event())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
room_events.push(since_member.0.to_sync_room_event()); room_events.push(since_member.0.to_sync_room_event());

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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