Skip to content

Commit 0464e54

Browse files
authored
Merge pull request #4 from yoshuawuyts/fix-compilation
Fix compilation issues after updating async-std to 0.99.8
2 parents dccd481 + 023c91d commit 0464e54

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ edition = "2018"
1515
httparse = "1.3.3"
1616
http = "0.1.17"
1717
futures-io-preview = "0.3.0-alpha.18"
18-
async-std = "0.99.4"
18+
async-std = "0.99.8"
1919
futures-core-preview = "0.3.0-alpha.18"
2020

2121
[dev-dependencies]

src/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
33
// use async_std::io::{self, BufRead, BufReader, Read};
44
// use async_std::task::{Context, Poll};
5-
use futures_io::AsyncRead;
6-
use http::{Request, Response};
5+
// use futures_io::AsyncRead;
6+
// use http::{Request, Response};
77

88
// use std::pin::Pin;
99

10-
use crate::{Body, Exception};
10+
// use crate::{Body, Exception};
1111

1212
/// An HTTP encoder.
1313
#[derive(Debug)]

src/server.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Process HTTP connections on the server.
22
3-
use async_std::io::{self, BufRead, BufReader};
3+
use async_std::io::{self, BufReader};
4+
use async_std::prelude::*;
45
use async_std::task::{Context, Poll};
56
use futures_core::ready;
67
use futures_io::AsyncRead;

tests/test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::error::Error;
44
fn server() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
55
use async_h1::server;
66
use async_std::prelude::*;
7-
use async_std::{net, task, io};
7+
use async_std::{io, net, task};
88

99
task::block_on(async {
1010
let server = task::spawn(async {
@@ -17,7 +17,8 @@ fn server() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
1717
let (reader, writer) = &mut (&stream, &stream);
1818
let req = server::decode(reader).await?;
1919
dbg!(req);
20-
let res = http::Response::new(async_h1::Body {});
20+
let body: async_h1::Body<&[u8]> = async_h1::Body::empty();
21+
let res = http::Response::new(body);
2122
let mut res = server::encode(res).await?;
2223
io::copy(&mut res, writer).await?;
2324
}

0 commit comments

Comments
 (0)