From df65cc7c56b3f9e2d7c64482d12564bcccc12405 Mon Sep 17 00:00:00 2001 From: Ticki Date: Sun, 13 Mar 2016 11:59:55 +0100 Subject: [PATCH] Nightly message --- examples/keys.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/keys.rs b/examples/keys.rs index 4df7ea7..215cf34 100644 --- a/examples/keys.rs +++ b/examples/keys.rs @@ -1,9 +1,11 @@ extern crate libterm; -use libterm::{TermRead, TermWrite, IntoRawMode, Key}; -use std::io::{Write, stdout, stdin}; +#[cfg(feature = "nightly")] fn main() { + use libterm::{TermRead, TermWrite, IntoRawMode, Key}; + use std::io::{Write, stdout, stdin}; + let stdin = stdin(); let mut stdout = stdout().into_raw_mode().unwrap(); @@ -35,3 +37,7 @@ fn main() { stdout.show_cursor().unwrap(); } +#[cfg(not(feature = "nightly"))] +fn main() { + println!("To run this example, you need to enable the `nightly` feature. Use Rust nightly and compile with `--features nightly`.") +}