From 7af3b3f9560d1e2933ae240cebb3a3323a3753ae Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 2 Jan 2018 19:43:59 -0800 Subject: [PATCH] update example --- .travis.yml | 4 ++-- examples/diesel/src/main.rs | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c55bbde6..ce14e6369 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ rust: - 1.20.0 - stable - beta - - nightly-2017-12-21 + - nightly sudo: required dist: trusty @@ -58,7 +58,7 @@ script: # Upload docs after_success: - | - if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_RUST_VERSION" == "nightly-2017-12-21" ]]; then + if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_RUST_VERSION" == "nightly" ]]; then cargo doc --features alpn --no-deps && echo "" > target/doc/index.html && cargo install mdbook && diff --git a/examples/diesel/src/main.rs b/examples/diesel/src/main.rs index a5b25b21d..56d7c2dc2 100644 --- a/examples/diesel/src/main.rs +++ b/examples/diesel/src/main.rs @@ -19,7 +19,8 @@ extern crate env_logger; use actix::*; use actix_web::*; use actix::prelude::*; -#[cfg(target_os = "linux")] use actix::actors::signal::{ProcessSignals, Subscribe}; +#[cfg(unix)] +use actix::actors::signal::{ProcessSignals, Subscribe}; use diesel::prelude::*; use futures::future::Future; @@ -70,10 +71,10 @@ fn main() { .bind("127.0.0.1:8080").unwrap() .start(); - if cfg!(target_os = "linux") { // Subscribe to unix signals - let signals = Arbiter::system_registry().get::(); - signals.send(Subscribe(_addr.subscriber())); - } + // Subscribe to unix signals + #[cfg(unix)] + { let signals = Arbiter::system_registry().get::(); + signals.send(Subscribe(_addr.subscriber())); } println!("Started http server: 127.0.0.1:8080"); let _ = sys.run();