Skip to content

Commit c36ba06

Browse files
committed
Update dependencies
This updates mainly to tokio 1.0 and hyper 0.14, but includes other side dependency updates as well.
1 parent df6c2ce commit c36ba06

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

Cargo.toml

+9-9
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ log = "0.4"
3737
serde = "1.0"
3838
serde_derive = "1.0"
3939
serde_json = "1.0"
40-
serde_ignored = "0.0.4"
41-
serde-tuple-vec-map = "0.2"
40+
serde_ignored = "0.1"
41+
serde-tuple-vec-map = "1.0"
4242
arrayvec = "0.5"
4343
time = "0.1"
4444
# HTTP
4545
futures = "0.3"
4646
url = "2.0"
47-
hyper = "0.13"
48-
bytes = "0.5"
47+
hyper = { version = "0.14", features = ["client", "http1", "stream"] }
48+
bytes = "1.0"
4949
# Sync HTTP wrapper
50-
tokio = { version = "0.2", optional = true }
51-
hyper-tls = { version = "0.4", optional = true }
50+
tokio = { version = "1.0", optional = true }
51+
hyper-tls = { version = "0.5", optional = true }
5252
# Websockets
53-
rand = "0.7"
53+
rand = "0.8"
5454
num = { version = "0.3", default-features = false }
5555

5656
[features]
57-
sync = ["tokio", "hyper-tls"]
57+
sync = ["tokio", "hyper-tls", "tokio/rt-multi-thread"]
5858
protocol-docs = []
5959
default = ["sync"]
6060
# enables tests which modify game state (temporarily, but still)
@@ -71,7 +71,7 @@ clap = "2"
7171
# socket connections in ws-debug example
7272
futures01 = { package = "futures", version = "0.1" }
7373
tokio01 = { package = "tokio", version = "0.1" }
74-
websocket = "0.23"
74+
websocket = "0.26"
7575
# pretty printing in ws-debug.
7676
serde_json = "1"
7777

src/error.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub enum ErrorKind {
1818
/// URL parsing error.
1919
Url(url::ParseError),
2020
/// Error connecting to the server, or error parsing a URL provided.
21-
Hyper(hyper::error::Error),
21+
Hyper(hyper::Error),
2222
/// IO error.
2323
Io(io::Error),
2424
/// Error for when the server responds with a non-success HTTP status code.
@@ -164,8 +164,8 @@ impl From<serde_json::error::Error> for Error {
164164
}
165165
}
166166

167-
impl From<hyper::error::Error> for Error {
168-
fn from(err: hyper::error::Error) -> Error {
167+
impl From<hyper::Error> for Error {
168+
fn from(err: hyper::Error) -> Error {
169169
ErrorKind::Hyper(err).into()
170170
}
171171
}

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub struct Api<C> {
141141
/// The authentication token.
142142
auth_token: TokenStorage,
143143
/// The hyper client.
144-
client: hyper::Client<C>,
144+
client: hyper::client::Client<C>,
145145
}
146146

147147
impl<C> Clone for Api<C>
@@ -173,7 +173,7 @@ impl<C> Api<C> {
173173
/// The returned instance can be used to make anonymous calls. Use [`Api::with_token`] or
174174
/// [`Api::set_token`] to enable authenticated access.
175175
#[inline]
176-
pub fn new(client: hyper::Client<C>) -> Self {
176+
pub fn new(client: hyper::client::Client<C>) -> Self {
177177
Api {
178178
url: default_url(),
179179
client: client,

src/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66
};
77

88
use hyper::client::HttpConnector;
9-
use hyper::{self, Client};
9+
use hyper::{self, client::Client};
1010
use hyper_tls::HttpsConnector;
1111

1212
use crate::{

src/websocket/connecting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn transform_url<U: AsRef<str> + ?Sized>(url: &U) -> Result<Url, UrlError> {
125125
impl fmt::Display for GenServerAndSessionId {
126126
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
127127
let mut rng = rand::thread_rng();
128-
write!(f, "../socket/{:04}/", rng.gen_range(0, 1000))?;
128+
write!(f, "../socket/{:04}/", rng.gen_range(0..1000))?;
129129

130130
for _ in 0..8 {
131131
write!(f, "{}", *VALID_CHARS.choose(&mut rng).unwrap() as char)?;

0 commit comments

Comments
 (0)