Merge pull request #146 from Kroisse/fix/develop/deprecations

Fix deprecated codes
This commit is contained in:
Aaron Weiss 2018-08-27 19:27:08 -04:00 committed by GitHub
commit 45deaa0978
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 12 deletions

View file

@ -29,12 +29,13 @@ chrono = "0.4"
encoding = "0.2"
failure = "0.1"
futures = "0.1"
log = "0.3"
log = "0.4"
native-tls = "0.1"
serde = "1.0"
serde_derive = "1.0"
serde_json = { version = "1.0", optional = true }
serde_yaml = { version = "0.7", optional = true }
tokio-codec = "0.1"
tokio-core = "0.1"
tokio-io = "0.1"
tokio-mockstream = "1.1"

View file

@ -7,9 +7,9 @@ use encoding::EncoderTrap;
use encoding::label::encoding_from_whatwg_label;
use futures::{Async, Poll, Future, Sink, StartSend, Stream};
use native_tls::{Certificate, TlsConnector, Pkcs12};
use tokio_codec::Decoder;
use tokio_core::reactor::Handle;
use tokio_core::net::{TcpStream, TcpStreamNew};
use tokio_io::AsyncRead;
use tokio_mockstream::MockStream;
use tokio_tls::{TlsConnectorExt, TlsStream};
@ -81,13 +81,15 @@ impl<'a> Future for ConnectionFuture<'a> {
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
match *self {
ConnectionFuture::Unsecured(config, ref mut inner) => {
let framed = try_ready!(inner.poll()).framed(IrcCodec::new(config.encoding())?);
let stream = try_ready!(inner.poll());
let framed = IrcCodec::new(config.encoding())?.framed(stream);
let transport = IrcTransport::new(config, framed);
Ok(Async::Ready(Connection::Unsecured(transport)))
}
ConnectionFuture::Secured(config, ref mut inner) => {
let framed = try_ready!(inner.poll()).framed(IrcCodec::new(config.encoding())?);
let stream = try_ready!(inner.poll());
let framed = IrcCodec::new(config.encoding())?.framed(stream);
let transport = IrcTransport::new(config, framed);
Ok(Async::Ready(Connection::Secured(transport)))
@ -109,7 +111,8 @@ impl<'a> Future for ConnectionFuture<'a> {
})
};
let framed = MockStream::new(&initial?).framed(IrcCodec::new(config.encoding())?);
let stream = MockStream::new(&initial?);
let framed = IrcCodec::new(config.encoding())?.framed(stream);
let transport = IrcTransport::new(config, framed);
Ok(Async::Ready(Connection::Mock(Logged::wrap(transport))))

View file

@ -45,8 +45,6 @@
//! # }
//! ```
#[cfg(feature = "ctcp")]
use std::ascii::AsciiExt;
use std::collections::HashMap;
use std::path::Path;
use std::sync::{Arc, Mutex, RwLock};

View file

@ -6,8 +6,8 @@ use std::time::{Duration, Instant};
use futures::{Async, AsyncSink, Future, Poll, Sink, StartSend, Stream};
use chrono::prelude::*;
use tokio_codec::Framed;
use tokio_io::{AsyncRead, AsyncWrite};
use tokio_io::codec::Framed;
use tokio_timer;
use tokio_timer::{Interval, Sleep, Timer};

View file

@ -58,6 +58,7 @@ extern crate serde_derive;
extern crate serde_json;
#[cfg(feature = "yaml")]
extern crate serde_yaml;
extern crate tokio_codec;
extern crate tokio_core;
extern crate tokio_io;
extern crate tokio_mockstream;

View file

@ -102,10 +102,10 @@ impl FormattedStringExt for str {
impl FormattedStringExt for String {
fn is_formatted(&self) -> bool {
(&self).is_formatted()
(&self[..]).is_formatted()
}
fn strip_formatting(&self) -> Cow<str> {
(&self).strip_formatting()
(&self[..]).strip_formatting()
}
}

View file

@ -1,5 +1,4 @@
//! Enumeration of all available client commands.
use std::ascii::AsciiExt;
use std::str::FromStr;
use error::MessageParseError;

View file

@ -1,6 +1,6 @@
//! Implementation of IRC codec for Tokio.
use bytes::BytesMut;
use tokio_io::codec::{Decoder, Encoder};
use tokio_codec::{Decoder, Encoder};
use error;
use proto::line::LineCodec;