From 8bdd654952d530db8db4ae51668da696d74862e2 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Fri, 3 Apr 2020 20:55:59 +0200 Subject: [PATCH] Switch to Rust 2018 edition --- Cargo.toml | 1 + src/connection.rs | 18 +++++++++--------- src/error.rs | 2 +- src/main.rs | 17 ----------------- 4 files changed, 11 insertions(+), 27 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3923bca..d9638a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "mumble-web-proxy" version = "0.1.0" authors = ["Jonas Herzig "] +edition = "2018" [dependencies] argparse = "0.2.2" diff --git a/src/connection.rs b/src/connection.rs index 5be9b0f..7c35106 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -29,9 +29,9 @@ use tokio::prelude::*; use tokio::timer::Delay; use webrtc_sdp::attribute_type::SdpAttribute; -use error::Error; -use utils::EitherS; -use Config; +use crate::error::Error; +use crate::utils::EitherS; +use crate::Config; type SessionId = u32; @@ -85,14 +85,14 @@ impl User { pub struct Connection { config: Config, - inbound_client: Box, Error = Error>>, - outbound_client: Box, SinkError = Error>>, - inbound_server: Box, Error = Error>>, - outbound_server: Box, SinkError = Error>>, + inbound_client: Box, Error = Error>>, + outbound_client: Box, SinkError = Error>>, + inbound_server: Box, Error = Error>>, + outbound_server: Box, SinkError = Error>>, next_clientbound_frame: Option>, next_serverbound_frame: Option>, next_rtp_frame: Option>, - stream_to_be_sent: Option>>, + stream_to_be_sent: Option>>, ice: Option<(ice::Agent, ice::Stream)>, @@ -369,7 +369,7 @@ impl Connection { fn process_packet_from_client( &mut self, packet: ControlPacket, - ) -> Box> { + ) -> Box> { match packet { ControlPacket::Authenticate(mut message) => { println!("MSG Authenticate: {:?}", message); diff --git a/src/error.rs b/src/error.rs index ee82c05..9f3a234 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,7 +7,7 @@ pub enum Error { Io(std::io::Error), ServerTls(native_tls::Error), ClientConnection(tungstenite::Error), - Misc(Box), + Misc(Box), } impl Error { diff --git a/src/main.rs b/src/main.rs index 4ee82bf..39c1e1e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,23 +1,6 @@ // TODO For some reason, reconnecting without reloading the page and without disconnecting the // previous connection (i.e. multiple simultaneous connections) causes FF to reject our DTLS // cert. Works in Chrome, or in different tabs or when properly closing the old connection. -extern crate argparse; -extern crate byteorder; -extern crate bytes; -extern crate futures; -extern crate libnice; -extern crate mumble_protocol; -extern crate native_tls; -extern crate openssl; -extern crate rtp; -extern crate tokio; -extern crate tokio_codec; -extern crate tokio_core; -extern crate tokio_tls; -extern crate tokio_tungstenite; -extern crate tungstenite; -extern crate webrtc_sdp; - use argparse::StoreOption; use argparse::StoreTrue; use argparse::{ArgumentParser, Store};