Skip to content

Commit da33e3d

Browse files
committed
Add async_closure feature gate where needed
1 parent 25de413 commit da33e3d

File tree

12 files changed

+16
-16
lines changed

12 files changed

+16
-16
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: rust
2-
rust: nightly-2019-06-02
2+
rust: nightly-2019-07-08
33
cache: cargo
44

55
before_script:

examples/cors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(async_await)]
1+
#![feature(async_await, async_closure)]
22

33
use http::header::HeaderValue;
44
use tide::middleware::CorsMiddleware;

examples/default_headers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(async_await)]
1+
#![feature(async_await, async_closure)]
22

33
use tide::middleware::DefaultHeaders;
44

examples/hello.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(async_await)]
1+
#![feature(async_await, async_closure)]
22
fn main() {
33
let mut app = tide::App::new();
44
app.at("/").get(async move |_| "Hello, world!");

examples/hello_envlog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(async_await)]
1+
#![feature(async_await, async_closure)]
22
fn main() {
33
env_logger::from_env(env_logger::Env::default().default_filter_or("info")).init();
44
let mut app = tide::App::new();

examples/hello_logrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(async_await)]
1+
#![feature(async_await, async_closure)]
22
fn main() {
33
use log::LevelFilter;
44
use log4rs::append::console::ConsoleAppender;

examples/messages.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async fn set_message(mut cx: Context<Database>) -> EndpointResult<()> {
5151
if cx.state().set(id, msg) {
5252
Ok(())
5353
} else {
54-
Err(StatusCode::NOT_FOUND)?
54+
Err(StatusCode::NOT_FOUND.into())
5555
}
5656
}
5757

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

examples/runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(async_await)]
1+
#![feature(async_await, async_closure)]
22

33
/// An example of how to run a Tide service on top of `runtime`, this also shows the pieces
44
/// necessary if you wish to run a service on some other executor/IO source.

src/app.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::{
3030
/// on `127.0.0.1:8000` with:
3131
///
3232
/// ```rust, no_run
33-
/// #![feature(async_await)]
33+
/// #![feature(async_await, async_closure)]
3434
///
3535
/// let mut app = tide::App::new();
3636
/// app.at("/hello").get(async move |_| "Hello, world!");
@@ -45,7 +45,7 @@ use crate::{
4545
/// segments as parameters to endpoints:
4646
///
4747
/// ```rust, no_run
48-
/// #![feature(async_await)]
48+
/// #![feature(async_await, async_closure)]
4949
///
5050
/// use tide::error::ResultExt;
5151
///
@@ -166,7 +166,7 @@ impl<State: Send + Sync + 'static> App<State> {
166166
/// respective endpoint of the selected resource. Example:
167167
///
168168
/// ```rust,no_run
169-
/// # #![feature(async_await)]
169+
/// # #![feature(async_await, async_closure)]
170170
/// # let mut app = tide::App::new();
171171
/// app.at("/").get(async move |_| "Hello, world!");
172172
/// ```

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
#![cfg_attr(any(feature = "nightly", test), feature(external_doc))]
66
#![cfg_attr(feature = "nightly", doc(include = "../README.md"))]
7-
#![feature(async_await, existential_type)]
7+
#![feature(async_await, async_closure, existential_type)]
88
#![warn(
99
nonstandard_style,
1010
rust_2018_idioms,

tests/wildcard.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(async_await)]
1+
#![feature(async_await, async_closure)]
22

33
use futures::executor::block_on;
44
use http_service::Body;

tide-cors/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! ## Examples
44
//!
55
//! ```rust,no_run
6-
//! #![feature(async_await)]
6+
//! #![feature(async_await, async_closure)]
77
//!
88
//! use http::header::HeaderValue;
99
//! use tide_cors::CorsMiddleware;
@@ -30,7 +30,7 @@
3030
//!
3131
//! You will probably get a browser alert when running without cors middleware.
3232
33-
#![feature(async_await)]
33+
#![feature(async_await, async_closure)]
3434
#![warn(
3535
nonstandard_style,
3636
rust_2018_idioms,

0 commit comments

Comments
 (0)