Skip to content

Commit 85b85e9

Browse files
Nemo157yoshuawuyts
authored andcommitted
Update travis configuration (#228)
* Update travis config * Separate out individual build jobs for faster wall-clock testing * Fix clippy not actually denying warnings (excluded examples because these are currently failing and have non-trivial fixes) * Add build job that checks --no-default-features works * Add build job that checks for intra-doc-resolution failures (excluded tide because of bugs in re-exports with the intra-doc feature) * Fix warnings * Fix doc-link in tide-cookies
1 parent 77b3a1c commit 85b85e9

File tree

3 files changed

+37
-19
lines changed

3 files changed

+37
-19
lines changed

.travis.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
language: rust
2-
rust:
3-
- nightly-2019-05-09
4-
5-
before_script: |
6-
rustup component add rustfmt clippy
7-
script: |
8-
cargo fmt --all -- --check &&
9-
cargo clippy --all --all-features -- -D clippy::all &&
10-
cargo build --no-default-features --verbose &&
11-
cargo build --all --all-features --verbose &&
12-
cargo test --all --all-features --verbose
2+
rust: nightly-2019-05-09
133
cache: cargo
4+
5+
matrix:
6+
include:
7+
- name: cargo doc
8+
env: [CACHE_NAME=docs]
9+
script:
10+
- RUSTDOCFLAGS=-Dwarnings
11+
cargo doc --all --all-features --no-deps --exclude tide
12+
13+
- name: cargo fmt
14+
cache: false
15+
before_script: rustup component add rustfmt
16+
script: cargo fmt --all -- --check
17+
18+
- name: cargo clippy
19+
env: [CACHE_NAME=clippy]
20+
before_script: rustup component add clippy
21+
script: cargo clippy --all --all-targets --exclude examples -- -Dwarnings
22+
23+
- name: cargo build --no-default-features
24+
env: [CACHE_NAME=no-default-features]
25+
script:
26+
- cargo build --manifest-path tide/Cargo.toml --no-default-features
27+
- cargo build --manifest-path tide-core/Cargo.toml --no-default-features
28+
29+
- name: cargo test
30+
script: cargo test --all --verbose

tide-compression/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ mod tests {
289289
.header(ACCEPT_ENCODING, hval)
290290
.body(Body::empty())
291291
.unwrap();
292-
let res = server.simulate(req).unwrap();
293-
res
292+
server.simulate(req).unwrap()
294293
}
295294

296295
// Generates a decoded response given a request body and the header value representing its encoding.
@@ -301,8 +300,7 @@ mod tests {
301300
.header(CONTENT_ENCODING, hval)
302301
.body(body)
303302
.unwrap();
304-
let res = server.simulate(req).unwrap();
305-
res
303+
server.simulate(req).unwrap()
306304
}
307305

308306
#[test]

tide-cookies/src/middleware.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tide_core::{
99

1010
/// Middleware to work with cookies.
1111
///
12-
/// [`CookiesMiddleware`] along with [`ContextExt`](crate::cookies::ContextExt) provide smooth
12+
/// [`CookiesMiddleware`] along with [`ContextExt`](crate::data::ContextExt) provide smooth
1313
/// access to request cookies and setting/removing cookies from response. This leverages the
1414
/// [cookie](https://crates.io/crates/cookie) crate.
1515
/// This middleware parses cookies from request and caches them in the extension. Once the request
@@ -74,7 +74,11 @@ mod tests {
7474

7575
/// Tide will use the the `Cookies`'s `Extract` implementation to build this parameter.
7676
async fn retrieve_cookie(mut cx: Context<()>) -> String {
77-
format!("{}", cx.get_cookie(COOKIE_NAME).unwrap().unwrap().value())
77+
cx.get_cookie(COOKIE_NAME)
78+
.unwrap()
79+
.unwrap()
80+
.value()
81+
.to_string()
7882
}
7983

8084
async fn set_cookie(mut cx: Context<()>) {
@@ -109,8 +113,7 @@ mod tests {
109113
.header(http::header::COOKIE, "testCookie=RequestCookieValue")
110114
.body(Body::empty())
111115
.unwrap();
112-
let res = server.simulate(req).unwrap();
113-
res
116+
server.simulate(req).unwrap()
114117
}
115118

116119
#[test]

0 commit comments

Comments
 (0)