diff --git a/.travis.yml b/.travis.yml index 7a662d4f7..cc4c46432 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,30 @@ language: rust -rust: - - nightly-2019-05-09 - -before_script: | - rustup component add rustfmt clippy -script: | - cargo fmt --all -- --check && - cargo clippy --all --all-features -- -D clippy::all && - cargo build --no-default-features --verbose && - cargo build --all --all-features --verbose && - cargo test --all --all-features --verbose +rust: nightly-2019-05-09 cache: cargo + +matrix: + include: + - name: cargo doc + env: [CACHE_NAME=docs] + script: + - RUSTDOCFLAGS=-Dwarnings + cargo doc --all --all-features --no-deps --exclude tide + + - name: cargo fmt + cache: false + before_script: rustup component add rustfmt + script: cargo fmt --all -- --check + + - name: cargo clippy + env: [CACHE_NAME=clippy] + before_script: rustup component add clippy + script: cargo clippy --all --all-targets --exclude examples -- -Dwarnings + + - name: cargo build --no-default-features + env: [CACHE_NAME=no-default-features] + script: + - cargo build --manifest-path tide/Cargo.toml --no-default-features + - cargo build --manifest-path tide-core/Cargo.toml --no-default-features + + - name: cargo test + script: cargo test --all --verbose diff --git a/tide-compression/src/lib.rs b/tide-compression/src/lib.rs index e0f88be3a..4c1cad9b1 100644 --- a/tide-compression/src/lib.rs +++ b/tide-compression/src/lib.rs @@ -289,8 +289,7 @@ mod tests { .header(ACCEPT_ENCODING, hval) .body(Body::empty()) .unwrap(); - let res = server.simulate(req).unwrap(); - res + server.simulate(req).unwrap() } // Generates a decoded response given a request body and the header value representing its encoding. @@ -301,8 +300,7 @@ mod tests { .header(CONTENT_ENCODING, hval) .body(body) .unwrap(); - let res = server.simulate(req).unwrap(); - res + server.simulate(req).unwrap() } #[test] diff --git a/tide-cookies/src/middleware.rs b/tide-cookies/src/middleware.rs index 99142c82a..86f5ff87e 100644 --- a/tide-cookies/src/middleware.rs +++ b/tide-cookies/src/middleware.rs @@ -9,7 +9,7 @@ use tide_core::{ /// Middleware to work with cookies. /// -/// [`CookiesMiddleware`] along with [`ContextExt`](crate::cookies::ContextExt) provide smooth +/// [`CookiesMiddleware`] along with [`ContextExt`](crate::data::ContextExt) provide smooth /// access to request cookies and setting/removing cookies from response. This leverages the /// [cookie](https://crates.io/crates/cookie) crate. /// This middleware parses cookies from request and caches them in the extension. Once the request @@ -74,7 +74,11 @@ mod tests { /// Tide will use the the `Cookies`'s `Extract` implementation to build this parameter. async fn retrieve_cookie(mut cx: Context<()>) -> String { - format!("{}", cx.get_cookie(COOKIE_NAME).unwrap().unwrap().value()) + cx.get_cookie(COOKIE_NAME) + .unwrap() + .unwrap() + .value() + .to_string() } async fn set_cookie(mut cx: Context<()>) { @@ -109,8 +113,7 @@ mod tests { .header(http::header::COOKIE, "testCookie=RequestCookieValue") .body(Body::empty()) .unwrap(); - let res = server.simulate(req).unwrap(); - res + server.simulate(req).unwrap() } #[test]