Skip to content

Commit b3a9b96

Browse files
authored
Merge pull request http-rs#348 from Fishrock123/ci-improvements
ci: another round of improvements
2 parents 6e0cd01 + 4845f1f commit b3a9b96

File tree

3 files changed

+43
-30
lines changed

3 files changed

+43
-30
lines changed

.github/workflows/ci.yaml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ on:
88
- staging
99
- trying
1010

11-
env:
12-
RUSTFLAGS: -Dwarnings
13-
1411
jobs:
1512
build_and_test:
1613
name: Build and test
@@ -23,7 +20,7 @@ jobs:
2320
steps:
2421
- uses: actions/checkout@master
2522

26-
- name: Install ${{ matrix.rust }}
23+
- name: Install ${{ matrix.rust }} toolchain
2724
uses: actions-rs/toolchain@v1
2825
with:
2926
toolchain: ${{ matrix.rust }}
@@ -33,13 +30,13 @@ jobs:
3330
uses: actions-rs/cargo@v1
3431
with:
3532
command: check
36-
args: --workspace --benches --bins --examples --tests --features hyperium_http
33+
args: --workspace --all-targets --features hyperium_http
3734

3835
- name: check unstable
3936
uses: actions-rs/cargo@v1
4037
with:
4138
command: check
42-
args: --workspace --benches --bins --examples --tests --features "hyperium_http,unstable"
39+
args: --workspace --all-targets --features "hyperium_http,unstable"
4340

4441
- name: tests
4542
uses: actions-rs/cargo@v1
@@ -53,31 +50,36 @@ jobs:
5350
steps:
5451
- uses: actions/checkout@master
5552

53+
- name: Install nightly toolchain
54+
uses: actions-rs/toolchain@v1
55+
with:
56+
profile: minimal
57+
toolchain: nightly
58+
override: true
59+
components: clippy, rustfmt
60+
5661
- name: clippy
57-
run: cargo clippy --workspace --benches --bins --examples --tests --features "hyperium_http,unstable" -- -D warnings
62+
run: cargo clippy --workspace --all-targets --features "hyperium_http,unstable"
5863

5964
- name: fmt
6065
run: cargo fmt --all -- --check
6166

6267
- name: docs
6368
run: cargo doc --no-deps
6469

65-
# check_wasm:
66-
# name: Check wasm targets
67-
# runs-on: ubuntu-latest
68-
69-
# steps:
70-
# - uses: actions/checkout@master
71-
72-
# - name: Install nightly with wasm32-unknown-unknown
73-
# uses: actions-rs/toolchain@v1
74-
# with:
75-
# toolchain: nightly
76-
# target: wasm32-unknown-unknown
77-
# override: true
78-
79-
# - name: check
80-
# uses: actions-rs/cargo@v1
81-
# with:
82-
# command: check
83-
# args: --target wasm32-unknown-unknown
70+
check_wasm:
71+
name: Check wasm targets
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- uses: actions/checkout@master
76+
77+
- name: Install nightly with wasm32-unknown-unknown
78+
uses: actions-rs/toolchain@v1
79+
with:
80+
toolchain: nightly
81+
target: wasm32-unknown-unknown
82+
override: true
83+
84+
- name: check
85+
run: cargo check --target wasm32-unknown-unknown --no-default-features --features=fs,serde

src/content/media_type_proposal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl MediaTypeProposal {
5757
.remove_param("q")
5858
.map(|param| param.as_str().parse())
5959
.transpose()?;
60-
Ok(Self::new(media_type, weight)?)
60+
Self::new(media_type, weight)
6161
}
6262
}
6363

src/mime/constants.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,23 @@ macro_rules! mime_const {
2020
};
2121

2222
(with_params, $name:ident, $desc:expr, $base:expr, $sub:expr, $is_utf8:expr, $doccomment:expr) => {
23-
mime_const!(doc_expanded, $name, $desc, $base, $sub, $is_utf8,
24-
concat!(
23+
mime_const!(
24+
doc_expanded,
25+
$name,
26+
$desc,
27+
$base,
28+
$sub,
29+
$is_utf8,
30+
concat!(
2531
"Content-Type for ",
2632
$desc,
2733
".\n\n# Mime Type\n\n```text\n",
28-
$base, "/", $sub, $doccomment, "\n```")
34+
$base,
35+
"/",
36+
$sub,
37+
$doccomment,
38+
"\n```"
39+
)
2940
);
3041
};
3142

0 commit comments

Comments
 (0)