From 79c4bf29c28ca187e8104253b3fd2e3d171ed188 Mon Sep 17 00:00:00 2001 From: nabijaczleweli Date: Mon, 10 Oct 2016 01:42:55 +0200 Subject: [PATCH] Don't explicitly list features --- Cargo.toml | 9 +++------ src/backend/curses/mod.rs | 8 ++++---- src/backend/curses/pan.rs | 2 +- src/backend/mod.rs | 4 ++-- src/lib.rs | 12 ++++++------ 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1d7350c..9b34882 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,12 +14,6 @@ version = "0.3.1" [build-dependencies] skeptic = "0.6" -[features] -cursive_ncurses = ["ncurses"] -cursive_pancurses = ["pancurses"] -cursive_termion = ["termion"] -default = ["cursive_ncurses"] - [dependencies] odds = "0.2" toml = "0.2" @@ -44,5 +38,8 @@ optional = true rand = "0.3" skeptic = "0.6" +[features] +default = ["ncurses"] + [lib] name = "cursive" diff --git a/src/backend/curses/mod.rs b/src/backend/curses/mod.rs index bb1f137..fa5a6df 100644 --- a/src/backend/curses/mod.rs +++ b/src/backend/curses/mod.rs @@ -1,13 +1,13 @@ use theme::{BaseColor, Color}; -#[cfg(feature = "cursive_ncurses")] +#[cfg(feature = "ncurses")] mod n; -#[cfg(feature = "cursive_ncurses")] +#[cfg(feature = "ncurses")] pub use self::n::*; -#[cfg(feature = "cursive_pancurses")] +#[cfg(feature = "pancurses")] mod pan; -#[cfg(feature = "cursive_pancurses")] +#[cfg(feature = "pancurses")] pub use self::pan::*; diff --git a/src/backend/curses/pan.rs b/src/backend/curses/pan.rs index c555085..d570f0e 100644 --- a/src/backend/curses/pan.rs +++ b/src/backend/curses/pan.rs @@ -72,7 +72,7 @@ impl backend::Backend for PancursesBackend { self.window.clear(); } - fn refresh(&self) { + fn refresh(&mut self) { self.window.refresh(); } diff --git a/src/backend/mod.rs b/src/backend/mod.rs index ea562cf..940725d 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -1,12 +1,12 @@ use event; use theme; -#[cfg(feature = "cursive_termion")] +#[cfg(feature = "termion")] mod termion; mod curses; pub use self::curses::*; -#[cfg(feature = "cursive_termion")] +#[cfg(feature = "termion")] pub use self::termion::*; pub trait Backend { diff --git a/src/lib.rs b/src/lib.rs index e5bc4ef..439d314 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,11 +56,11 @@ //! and log to it instead of stdout. #![deny(missing_docs)] -#[cfg(feature = "cursive_ncurses")] +#[cfg(feature = "ncurses")] extern crate ncurses; -#[cfg(feature = "cursive_pancurses")] +#[cfg(feature = "pancurses")] extern crate pancurses; -#[cfg(feature = "cursive_termion")] +#[cfg(feature = "termion")] extern crate termion; extern crate toml; extern crate unicode_segmentation; @@ -158,13 +158,13 @@ pub struct Cursive { new_default!(Cursive); #[doc(hidden)] -#[cfg(feature = "cursive_ncurses")] +#[cfg(feature = "ncurses")] pub type B = backend::NcursesBackend; #[doc(hidden)] -#[cfg(feature = "cursive_pancurses")] +#[cfg(feature = "pancurses")] pub type B = backend::PancursesBackend; #[doc(hidden)] -#[cfg(feature = "cursive_termion")] +#[cfg(feature = "termion")] pub type B = backend::TermionBackend; impl Cursive {