Skip to content

Add async_closure feature gate where needed #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: rust
rust: nightly-2019-06-02
rust: nightly-2019-07-08
cache: cargo

before_script:
Expand Down
2 changes: 1 addition & 1 deletion examples/cors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await)]
#![feature(async_await, async_closure)]

use http::header::HeaderValue;
use tide::middleware::CorsMiddleware;
Expand Down
2 changes: 1 addition & 1 deletion examples/default_headers.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await)]
#![feature(async_await, async_closure)]

use tide::middleware::DefaultHeaders;

Expand Down
2 changes: 1 addition & 1 deletion examples/hello.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await)]
#![feature(async_await, async_closure)]
fn main() {
let mut app = tide::App::new();
app.at("/").get(async move |_| "Hello, world!");
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_envlog.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await)]
#![feature(async_await, async_closure)]
fn main() {
env_logger::from_env(env_logger::Env::default().default_filter_or("info")).init();
let mut app = tide::App::new();
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_logrs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await)]
#![feature(async_await, async_closure)]
fn main() {
use log::LevelFilter;
use log4rs::append::console::ConsoleAppender;
Expand Down
4 changes: 2 additions & 2 deletions examples/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async fn set_message(mut cx: Context<Database>) -> EndpointResult<()> {
if cx.state().set(id, msg) {
Ok(())
} else {
Err(StatusCode::NOT_FOUND)?
Err(StatusCode::NOT_FOUND.into())
}
}

Expand All @@ -60,7 +60,7 @@ async fn get_message(cx: Context<Database>) -> EndpointResult {
if let Some(msg) = cx.state().get(id) {
Ok(response::json(msg))
} else {
Err(StatusCode::NOT_FOUND)?
Err(StatusCode::NOT_FOUND.into())
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/runtime.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await)]
#![feature(async_await, async_closure)]

/// 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.
Expand Down
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::{
/// on `127.0.0.1:8000` with:
///
/// ```rust, no_run
/// #![feature(async_await)]
/// #![feature(async_await, async_closure)]
///
/// let mut app = tide::App::new();
/// app.at("/hello").get(async move |_| "Hello, world!");
Expand All @@ -45,7 +45,7 @@ use crate::{
/// segments as parameters to endpoints:
///
/// ```rust, no_run
/// #![feature(async_await)]
/// #![feature(async_await, async_closure)]
///
/// use tide::error::ResultExt;
///
Expand Down Expand Up @@ -166,7 +166,7 @@ impl<State: Send + Sync + 'static> App<State> {
/// respective endpoint of the selected resource. Example:
///
/// ```rust,no_run
/// # #![feature(async_await)]
/// # #![feature(async_await, async_closure)]
/// # let mut app = tide::App::new();
/// app.at("/").get(async move |_| "Hello, world!");
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#![cfg_attr(any(feature = "nightly", test), feature(external_doc))]
#![cfg_attr(feature = "nightly", doc(include = "../README.md"))]
#![feature(async_await, existential_type)]
#![feature(async_await, async_closure, existential_type)]
#![warn(
nonstandard_style,
rust_2018_idioms,
Expand Down
2 changes: 1 addition & 1 deletion tests/wildcard.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await)]
#![feature(async_await, async_closure)]

use futures::executor::block_on;
use http_service::Body;
Expand Down
4 changes: 2 additions & 2 deletions tide-cors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! ## Examples
//!
//! ```rust,no_run
//! #![feature(async_await)]
//! #![feature(async_await, async_closure)]
//!
//! use http::header::HeaderValue;
//! use tide_cors::CorsMiddleware;
Expand All @@ -30,7 +30,7 @@
//!
//! You will probably get a browser alert when running without cors middleware.

#![feature(async_await)]
#![feature(async_await, async_closure)]
#![warn(
nonstandard_style,
rust_2018_idioms,
Expand Down