Skip to content

Commit 892720b

Browse files
authored
Merge pull request #59 from yoshuawuyts/release
Use http-types 1.0.0
2 parents 7ff68fd + 6c3fc0c commit 892720b

File tree

5 files changed

+73
-9
lines changed

5 files changed

+73
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- staging
8+
- trying
9+
10+
env:
11+
RUSTFLAGS: -Dwarnings
12+
13+
jobs:
14+
build_and_test:
15+
name: Build and test
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macOS-latest]
20+
rust: [nightly]
21+
22+
steps:
23+
- uses: actions/checkout@master
24+
25+
- name: Install ${{ matrix.rust }}
26+
uses: actions-rs/toolchain@v1
27+
with:
28+
toolchain: ${{ matrix.rust }}
29+
override: true
30+
31+
- name: check
32+
uses: actions-rs/cargo@v1
33+
with:
34+
command: check
35+
args: --all --bins --examples
36+
37+
- name: check unstable
38+
uses: actions-rs/cargo@v1
39+
with:
40+
command: check
41+
args: --all --benches --bins --examples --tests
42+
43+
- name: tests
44+
uses: actions-rs/cargo@v1
45+
with:
46+
command: test
47+
args: --all
48+
49+
check_fmt_and_docs:
50+
name: Checking fmt and docs
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@master
54+
- uses: actions-rs/toolchain@v1
55+
with:
56+
toolchain: nightly
57+
components: rustfmt, clippy
58+
override: true
59+
60+
- name: fmt
61+
run: cargo fmt --all -- --check
62+
63+
- name: Docs
64+
run: cargo doc

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ edition = "2018"
1515
url = "2.1.0"
1616
httparse = "1.3.3"
1717
async-std = { version = "1.5.0", features = ["unstable"] }
18-
http-types = { path = '../http-types' }
18+
http-types = "1.0.0"
1919
pin-project-lite = "0.1.1"
2020
byte-pool = "0.2.1"
2121
lazy_static = "1.4.0"

examples/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use async_h1::client;
2-
use async_std::net::{TcpStream};
2+
use async_std::net::TcpStream;
33
use http_types::{Error, Method, Request, Url};
44

55
#[async_std::main]

examples/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use async_std::net::{TcpStream, TcpListener};
1+
use async_std::net::{TcpListener, TcpStream};
22
use async_std::prelude::*;
33
use async_std::task;
44
use http_types::{Response, StatusCode};

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
//! use async_h1::client;
3131
//! use async_std::net::{TcpStream};
3232
//! use http_types::{Error, Method, Request, Url};
33-
//!
33+
//!
3434
//! #[async_std::main]
3535
//! async fn main() -> Result<(), Error> {
3636
//! let stream = TcpStream::connect("127.0.0.1:8080").await?;
3737
//! let peer_addr = stream.peer_addr()?;
3838
//! println!("connecting to {}", peer_addr);
39-
//!
39+
//!
4040
//! for i in 0usize..2 {
4141
//! println!("making request {}/2", i + 1);
4242
//! let url = Url::parse(&format!("http://{}/foo", peer_addr)).unwrap();
@@ -55,14 +55,14 @@
5555
//! use async_std::prelude::*;
5656
//! use async_std::task;
5757
//! use http_types::{Response, StatusCode};
58-
//!
58+
//!
5959
//! #[async_std::main]
6060
//! async fn main() -> http_types::Result<()> {
6161
//! // Open up a TCP connection and create a URL.
6262
//! let listener = TcpListener::bind(("127.0.0.1", 8080)).await?;
6363
//! let addr = format!("http://{}", listener.local_addr()?);
6464
//! println!("listening on {}", addr);
65-
//!
65+
//!
6666
//! // For each incoming TCP connection, spawn a task and call `accept`.
6767
//! let mut incoming = listener.incoming();
6868
//! while let Some(stream) = incoming.next().await {
@@ -76,7 +76,7 @@
7676
//! }
7777
//! Ok(())
7878
//! }
79-
//!
79+
//!
8080
//! // Take a TCP stream, and convert it into sequential HTTP request / response pairs.
8181
//! async fn accept(addr: String, stream: TcpStream) -> http_types::Result<()> {
8282
//! println!("starting new connection from {}", stream.peer_addr()?);
@@ -99,9 +99,9 @@
9999
/// The maximum amount of headers parsed on the server.
100100
const MAX_HEADERS: usize = 128;
101101

102-
mod server;
103102
mod chunked;
104103
mod date;
104+
mod server;
105105

106106
#[doc(hidden)]
107107
pub mod client;

0 commit comments

Comments
 (0)