From 0c2fd6d658a26f539f81138cc3486b72bca7f4ae Mon Sep 17 00:00:00 2001 From: Artem Vorotnikov Date: Wed, 21 Aug 2019 11:25:17 +0300 Subject: [PATCH] Bump http-service dependency in tide-panic, set CI to nightly-2019-08-21, remove async_await feature flag everywhere --- .travis.yml | 2 +- Cargo.toml | 6 +++--- README.md | 2 -- examples/body_types.rs | 1 - examples/catch_all.rs | 1 - examples/cookies.rs | 1 - examples/cors.rs | 2 -- examples/default_headers.rs | 2 -- examples/graphql.rs | 1 - examples/hello.rs | 1 - examples/hello_envlog.rs | 1 - examples/hello_logrs.rs | 1 - examples/messages.rs | 2 -- examples/multipart_form/mod.rs | 1 - examples/runtime.rs | 2 -- examples/staticfile.rs | 2 -- examples/templating_tera.rs | 2 -- rfcs/001-app-new.md | 4 ---- src/app.rs | 7 ------- src/lib.rs | 1 - tests/head_response_empty_body.rs | 2 -- tests/wildcard.rs | 2 -- tide-compression/Cargo.toml | 4 ++-- tide-compression/examples/simple.rs | 1 - tide-compression/src/lib.rs | 1 - tide-cookies/Cargo.toml | 4 ++-- tide-cookies/src/lib.rs | 1 - tide-core/Cargo.toml | 2 +- tide-core/src/endpoint.rs | 5 +---- tide-core/src/lib.rs | 1 - tide-cors/Cargo.toml | 4 ++-- tide-cors/README.md | 2 -- tide-cors/src/lib.rs | 3 --- tide-forms/Cargo.toml | 2 +- tide-forms/src/lib.rs | 1 - tide-headers/src/lib.rs | 1 - tide-log/src/lib.rs | 1 - tide-panic/Cargo.toml | 2 +- tide-panic/src/lib.rs | 2 +- tide-querystring/Cargo.toml | 4 ++-- tide-querystring/src/lib.rs | 3 --- tide-slog/src/lib.rs | 1 - 42 files changed, 17 insertions(+), 74 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6ea64efe2..c4a55e0ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: rust -rust: nightly-2019-07-31 +rust: nightly-2019-08-21 before_script: - > diff --git a/Cargo.toml b/Cargo.toml index 46f7db41e..087de1b68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,8 +27,8 @@ hyper = ["http-service-hyper"] [dependencies] futures-preview = "0.3.0-alpha.17" http = "0.1" -http-service = "0.3.0" -http-service-hyper = { version = "0.4.0", optional = true } +http-service = "0.3.1" +http-service-hyper = { version = "0.3.1", optional = true } # Routing fnv = "1.0.6" route-recognizer = "0.1.13" @@ -47,7 +47,7 @@ cookie = { version = "0.12", features = ["percent-encode"] } env_logger = "0.6.1" futures-fs = "0.0.5" futures-util-preview = { version = "0.3.0-alpha.17", features = ["compat"] } -http-service-mock = "0.3.0" +http-service-mock = "0.3.1" juniper = "0.13.0" log = "0.4.6" log4rs = "0.8.3" diff --git a/README.md b/README.md index d57a569f0..728baedc1 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,6 @@ Ecosystem WG, and **not ready for production use yet**. **Hello World** ```rust,no_run -#![feature(async_await)] - fn main() -> Result<(), std::io::Error> { let mut app = tide::App::new(); app.at("/").get(|_| async move { "Hello, world!" }); diff --git a/examples/body_types.rs b/examples/body_types.rs index 18269bfb0..999f5859b 100644 --- a/examples/body_types.rs +++ b/examples/body_types.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] use serde::{Deserialize, Serialize}; use tide::{ error::ResultExt, diff --git a/examples/catch_all.rs b/examples/catch_all.rs index 7ff1980d5..bfb864d6f 100644 --- a/examples/catch_all.rs +++ b/examples/catch_all.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] use tide::Context; async fn echo_path(cx: Context<()>) -> String { diff --git a/examples/cookies.rs b/examples/cookies.rs index 92820e6a8..3dd07a054 100644 --- a/examples/cookies.rs +++ b/examples/cookies.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] use cookie::Cookie; use tide::{cookies::ContextExt, middleware::CookiesMiddleware, Context}; diff --git a/examples/cors.rs b/examples/cors.rs index a62fc0450..0393fdd65 100644 --- a/examples/cors.rs +++ b/examples/cors.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use http::header::HeaderValue; use tide::middleware::{CorsMiddleware, CorsOrigin}; diff --git a/examples/default_headers.rs b/examples/default_headers.rs index f4ff40268..48374035f 100644 --- a/examples/default_headers.rs +++ b/examples/default_headers.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use tide::middleware::DefaultHeaders; fn main() { diff --git a/examples/graphql.rs b/examples/graphql.rs index f79527c12..23c4792de 100644 --- a/examples/graphql.rs +++ b/examples/graphql.rs @@ -2,7 +2,6 @@ // a look at [the Juniper book]. // // [the Juniper book]: https://graphql-rust.github.io/ -#![feature(async_await)] use http::status::StatusCode; use juniper::graphql_object; use std::sync::{atomic, Arc}; diff --git a/examples/hello.rs b/examples/hello.rs index 1ceac0961..061bee0eb 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] fn main() { let mut app = tide::App::new(); app.at("/").get(|_| async move { "Hello, world!" }); diff --git a/examples/hello_envlog.rs b/examples/hello_envlog.rs index a96c39bac..da44e0e83 100644 --- a/examples/hello_envlog.rs +++ b/examples/hello_envlog.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] fn main() { env_logger::from_env(env_logger::Env::default().default_filter_or("info")).init(); let mut app = tide::App::new(); diff --git a/examples/hello_logrs.rs b/examples/hello_logrs.rs index 49bf8ac61..87bc1b5a9 100644 --- a/examples/hello_logrs.rs +++ b/examples/hello_logrs.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] fn main() { use log::LevelFilter; use log4rs::append::console::ConsoleAppender; diff --git a/examples/messages.rs b/examples/messages.rs index 823ff0631..10b047ae4 100644 --- a/examples/messages.rs +++ b/examples/messages.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use http::status::StatusCode; use serde::{Deserialize, Serialize}; use std::sync::Mutex; diff --git a/examples/multipart_form/mod.rs b/examples/multipart_form/mod.rs index 0abef7c48..bf6acc4a4 100644 --- a/examples/multipart_form/mod.rs +++ b/examples/multipart_form/mod.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] use serde::{Deserialize, Serialize}; use std::io::Read; use tide::{forms::ContextExt, response, App, Context, EndpointResult}; diff --git a/examples/runtime.rs b/examples/runtime.rs index 034091306..fa8d2f95e 100644 --- a/examples/runtime.rs +++ b/examples/runtime.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - /// An example of how to run a Tide service on top of `runtime`, this also shows the pieces /// necessary if you wish to run a service on some other executor/IO source. diff --git a/examples/staticfile.rs b/examples/staticfile.rs index c1040887b..26b311e60 100644 --- a/examples/staticfile.rs +++ b/examples/staticfile.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use bytes::Bytes; use futures_fs::FsPool; use futures_util::compat::*; diff --git a/examples/templating_tera.rs b/examples/templating_tera.rs index 442d9ae3f..aae1c37b4 100644 --- a/examples/templating_tera.rs +++ b/examples/templating_tera.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use tera::{self, compile_templates}; use tide::{self, App, Context, EndpointResult, Error}; diff --git a/rfcs/001-app-new.md b/rfcs/001-app-new.md index 6e8e30bf6..c19c24b48 100644 --- a/rfcs/001-app-new.md +++ b/rfcs/001-app-new.md @@ -48,8 +48,6 @@ renamed to `Context::state`. __no state__ ```rust -#![feature(async_await)] - fn main() -> Result<(), failure::Error> { let mut app = tide::App::new(); app.at("/").get(|_| async move { "Hello, world!" }); @@ -59,8 +57,6 @@ fn main() -> Result<(), failure::Error> { __with state__ ```rust -#![feature(async_await)] - #[derive(Default)] struct State { /* db connection goes here */ diff --git a/src/app.rs b/src/app.rs index 0c6baff94..83914b379 100644 --- a/src/app.rs +++ b/src/app.rs @@ -30,8 +30,6 @@ use crate::{ /// on `127.0.0.1:8000` with: /// /// ```rust, no_run -/// #![feature(async_await)] -/// /// let mut app = tide::App::new(); /// app.at("/hello").get(|_| async move { "Hello, world!" }); /// app.run("127.0.0.1:8000"); @@ -45,8 +43,6 @@ use crate::{ /// segments as parameters to endpoints: /// /// ```rust, no_run -/// #![feature(async_await)] -/// /// use tide::error::ResultExt; /// /// async fn hello(cx: tide::Context<()>) -> tide::EndpointResult { @@ -75,8 +71,6 @@ use crate::{ /// # Application state /// /// ```rust, no_run -/// #![feature(async_await)] -/// /// use http::status::StatusCode; /// use serde::{Deserialize, Serialize}; /// use std::sync::Mutex; @@ -166,7 +160,6 @@ impl App { /// respective endpoint of the selected resource. Example: /// /// ```rust,no_run - /// # #![feature(async_await)] /// # let mut app = tide::App::new(); /// app.at("/").get(|_| async move { "Hello, world!" }); /// ``` diff --git a/src/lib.rs b/src/lib.rs index ebb0e72bd..a60d9b2f5 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,6 @@ #![cfg_attr(any(feature = "nightly", test), feature(external_doc))] #![cfg_attr(feature = "nightly", doc(include = "../README.md"))] -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms, diff --git a/tests/head_response_empty_body.rs b/tests/head_response_empty_body.rs index 40dfc414b..4db3ddd31 100644 --- a/tests/head_response_empty_body.rs +++ b/tests/head_response_empty_body.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use futures::executor::block_on; use http_service::Body; use http_service_mock::make_server; diff --git a/tests/wildcard.rs b/tests/wildcard.rs index 02f8330e6..be5119d4d 100644 --- a/tests/wildcard.rs +++ b/tests/wildcard.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use futures::executor::block_on; use http_service::Body; use http_service_mock::make_server; diff --git a/tide-compression/Cargo.toml b/tide-compression/Cargo.toml index 4e701c48f..12b194265 100644 --- a/tide-compression/Cargo.toml +++ b/tide-compression/Cargo.toml @@ -19,7 +19,7 @@ accept-encoding = "0.2.0-alpha.2" bytes = "0.4.12" futures-preview = "0.3.0-alpha.17" http = "0.1" -http-service = "0.3.0" +http-service = "0.3.1" [dependencies.async-compression] default-features = false @@ -28,4 +28,4 @@ version = "0.1.0-alpha.1" [dev-dependencies] tide = { path = "../", default-features = false } -http-service-mock = "0.3.0" +http-service-mock = "0.3.1" diff --git a/tide-compression/examples/simple.rs b/tide-compression/examples/simple.rs index 73484eac0..8a9849d39 100644 --- a/tide-compression/examples/simple.rs +++ b/tide-compression/examples/simple.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] use tide::{App, Context}; use tide_compression::{Compression, Decompression, Encoding}; diff --git a/tide-compression/src/lib.rs b/tide-compression/src/lib.rs index 326d6e0da..18ba3c9a5 100644 --- a/tide-compression/src/lib.rs +++ b/tide-compression/src/lib.rs @@ -3,7 +3,6 @@ #![cfg_attr(feature = "nightly", feature(external_doc))] #![cfg_attr(feature = "nightly", doc(include = "../README.md"))] -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms, diff --git a/tide-cookies/Cargo.toml b/tide-cookies/Cargo.toml index e18553183..a6a28325d 100644 --- a/tide-cookies/Cargo.toml +++ b/tide-cookies/Cargo.toml @@ -14,9 +14,9 @@ repository = "https://github.com/rustasync/tide" cookie = { version = "0.12", features = ["percent-encode"] } futures-preview = "0.3.0-alpha.17" http = "0.1" -http-service = "0.3.0" +http-service = "0.3.1" tide-core = { path = "../tide-core", default-features = false } [dev-dependencies] tide = { path = "../", default-features = false } -http-service-mock = "0.3.0" +http-service-mock = "0.3.1" diff --git a/tide-cookies/src/lib.rs b/tide-cookies/src/lib.rs index 18645641d..0d4130e74 100644 --- a/tide-cookies/src/lib.rs +++ b/tide-cookies/src/lib.rs @@ -1,7 +1,6 @@ //! Crate that provides helpers and/or middlewares for Tide //! related to cookies. -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms, diff --git a/tide-core/Cargo.toml b/tide-core/Cargo.toml index fc077a80c..e27d17d01 100644 --- a/tide-core/Cargo.toml +++ b/tide-core/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/rustasync/tide" [dependencies] futures-preview = "0.3.0-alpha.17" http = "0.1" -http-service = "0.3.0" +http-service = "0.3.1" serde = "1.0.91" serde_json = "1.0.39" route-recognizer = "0.1.13" diff --git a/tide-core/src/endpoint.rs b/tide-core/src/endpoint.rs index d4381db73..dca8afd79 100644 --- a/tide-core/src/endpoint.rs +++ b/tide-core/src/endpoint.rs @@ -13,14 +13,11 @@ use crate::{error::Error, response::IntoResponse, Context, Response}; /// # Examples /// /// Endpoints are implemented as asynchronous functions that make use of language features -/// currently only available in Rust Nightly. For this reason, we have to explicitly enable -/// those features with `#![feature(async_await)]`. To keep examples concise, -/// the attribute will be omitted in most of the documentation. +/// currently only available in Rust Nightly. /// /// A simple endpoint that is invoked on a `GET` request and returns a `String`: /// /// ```rust, no_run -/// # #![feature(async_await)] /// async fn hello(_cx: tide::Context<()>) -> String { /// String::from("hello") /// } diff --git a/tide-core/src/lib.rs b/tide-core/src/lib.rs index b61097996..31daf5d17 100644 --- a/tide-core/src/lib.rs +++ b/tide-core/src/lib.rs @@ -1,6 +1,5 @@ //! Core types and traits from Tide -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms, diff --git a/tide-cors/Cargo.toml b/tide-cors/Cargo.toml index ed774dfff..8712cbe13 100644 --- a/tide-cors/Cargo.toml +++ b/tide-cors/Cargo.toml @@ -16,9 +16,9 @@ edition = "2018" [dependencies] futures-preview = "0.3.0-alpha.17" http = "0.1" -http-service = "0.3.0" +http-service = "0.3.1" tide-core = { path = "../tide-core" } [dev-dependencies] tide = { path = "../" } -http-service-mock = "0.3.0" +http-service-mock = "0.3.1" diff --git a/tide-cors/README.md b/tide-cors/README.md index d59f42d06..54fac43a0 100644 --- a/tide-cors/README.md +++ b/tide-cors/README.md @@ -7,8 +7,6 @@ This crate provides cors-related middleware for Tide. Examples are in the `/examples` folder of this crate. ```rust,no_run -#![feature(async_await)] - use http::header::HeaderValue; use tide::middleware::CorsMiddleware; diff --git a/tide-cors/src/lib.rs b/tide-cors/src/lib.rs index 17356897a..fb1322671 100644 --- a/tide-cors/src/lib.rs +++ b/tide-cors/src/lib.rs @@ -3,8 +3,6 @@ //! ## Examples //! //! ```rust,no_run -//! #![feature(async_await)] -//! //! use http::header::HeaderValue; //! use tide::middleware::{CorsMiddleware, CorsOrigin}; //! @@ -30,7 +28,6 @@ //! //! You will probably get a browser alert when running without cors middleware. -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms, diff --git a/tide-forms/Cargo.toml b/tide-forms/Cargo.toml index cd2ca5349..af6f15fe6 100644 --- a/tide-forms/Cargo.toml +++ b/tide-forms/Cargo.toml @@ -18,7 +18,7 @@ version = "0.1.0" [dependencies] tide-core = { path = "../tide-core", default-features = false } -http-service = "0.3.0" +http-service = "0.3.1" futures-preview = "0.3.0-alpha.17" http = "0.1" log = "0.4.6" diff --git a/tide-forms/src/lib.rs b/tide-forms/src/lib.rs index 534e199f5..01c476b99 100644 --- a/tide-forms/src/lib.rs +++ b/tide-forms/src/lib.rs @@ -1,7 +1,6 @@ //! Crate that provides helpers and extensions for Tide //! related to forms. -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms, diff --git a/tide-headers/src/lib.rs b/tide-headers/src/lib.rs index e7b1dfd43..7e1d85c83 100644 --- a/tide-headers/src/lib.rs +++ b/tide-headers/src/lib.rs @@ -1,7 +1,6 @@ //! Crate that provides helpers and/or middlewares for Tide //! related to http headers. -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms, diff --git a/tide-log/src/lib.rs b/tide-log/src/lib.rs index 48123de6c..cdba3f396 100644 --- a/tide-log/src/lib.rs +++ b/tide-log/src/lib.rs @@ -1,7 +1,6 @@ //! Crate that provides helpers and/or middlewares for Tide //! related to logging. -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms, diff --git a/tide-panic/Cargo.toml b/tide-panic/Cargo.toml index 07e5fad0d..6df8b8411 100644 --- a/tide-panic/Cargo.toml +++ b/tide-panic/Cargo.toml @@ -11,5 +11,5 @@ repository = "https://github.com/rustasync/tide" [dependencies] futures-preview = "0.3.0-alpha.17" http = "0.1" -http-service = "0.2.0" +http-service = "0.3.1" tide-core = { path = "../tide-core" } diff --git a/tide-panic/src/lib.rs b/tide-panic/src/lib.rs index 3174a2a83..22edc12ee 100644 --- a/tide-panic/src/lib.rs +++ b/tide-panic/src/lib.rs @@ -4,7 +4,7 @@ //! Tide's default panic handling is not usable by your application. Before using these you should //! have a good understanding of how the different components involved in [`std::panic`] works. -#![feature(async_await, doc_cfg)] +#![feature(doc_cfg)] #![warn( nonstandard_style, rust_2018_idioms, diff --git a/tide-querystring/Cargo.toml b/tide-querystring/Cargo.toml index f59f2f6e0..354ccb653 100644 --- a/tide-querystring/Cargo.toml +++ b/tide-querystring/Cargo.toml @@ -26,5 +26,5 @@ serde_qs = "0.5.0" [dev-dependencies] tide = { path = "../", default-features = false } -http-service = "0.3.0" -http-service-mock = "0.3.0" +http-service = "0.3.1" +http-service-mock = "0.3.1" diff --git a/tide-querystring/src/lib.rs b/tide-querystring/src/lib.rs index 409217700..86e65e8ff 100644 --- a/tide-querystring/src/lib.rs +++ b/tide-querystring/src/lib.rs @@ -1,7 +1,6 @@ //! Crate that provides helpers and extensions for Tide //! related to query strings. -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms, @@ -20,8 +19,6 @@ use tide_core::{error::Error, Context}; /// Turning the query parameters into a `HashMap`: /// /// ``` -/// #![feature(async_await)] -/// /// # use std::collections::HashMap; /// use tide::querystring::ContextExt; /// diff --git a/tide-slog/src/lib.rs b/tide-slog/src/lib.rs index 3f8b2acbf..916180e36 100644 --- a/tide-slog/src/lib.rs +++ b/tide-slog/src/lib.rs @@ -2,7 +2,6 @@ //! related to structured logging with slog. #![cfg_attr(docrs, feature(doc_cfg))] -#![feature(async_await)] #![warn( nonstandard_style, rust_2018_idioms,