Merge this trash pls #1
2 changed files with 6 additions and 5 deletions
|
@ -49,7 +49,7 @@ fn get_tls_stream (config: &Value)
|
|||
)
|
||||
}
|
||||
|
||||
pub fn connect_irc<S: std::io::Read + std::io::Write> (config: &Value)
|
||||
pub fn connect_irc (config: &Value)
|
||||
-> Result<Box<dyn IrcReadWrite>, Box<dyn std::error::Error>> {
|
||||
// Weird workaround for multitrait dyn pointer
|
||||
// https://github.com/rust-lang/rfcs/issues/2035
|
||||
|
|
|
@ -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<T: IrcRead + IrcWrite> 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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue