diff --git a/src/connect.rs b/src/connect.rs index dc3ee6b..d0ff148 100644 --- a/src/connect.rs +++ b/src/connect.rs @@ -49,7 +49,7 @@ fn get_tls_stream (config: &Value) ) } -pub fn connect_irc (config: &Value) +pub fn connect_irc (config: &Value) -> Result, Box> { // Weird workaround for multitrait dyn pointer // https://github.com/rust-lang/rfcs/issues/2035 diff --git a/src/main.rs b/src/main.rs index 9fc6218..301fae1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,6 @@ use std::{ env::args, path::Path, io::Read, - net::TcpStream, collections::VecDeque, thread, time, @@ -33,9 +32,11 @@ use irc_proto::command::{ Command, }; use irc_proto::message::Message; -use irc_stream::{IrcStream, IrcRead, IrcWrite}; +use irc_stream::{ + IrcRead, + IrcWrite, +}; use toml::value::Value; -use native_tls::{TlsConnector,TlsStream}; trait IrcReadWrite: IrcRead + IrcWrite {} impl IrcReadWrite for T {} @@ -144,7 +145,7 @@ fn main() { .expect("no config given"); let config = get_config(config_path).expect("Could not get config"); - let stream = connect::connect_irc(&config).unwrap(); + let mut stream = connect::connect_irc(&config).unwrap(); let mut message_queue = get_irc_identify_messages(&config).unwrap();