From a50da6b6f63682486c757604f74f46a124af909f Mon Sep 17 00:00:00 2001
From: gwenn <gtreguier@gmail.com>
Date: Sat, 30 Jul 2016 08:44:40 +0200
Subject: [PATCH] Fix warnings

---
 src/lib.rs | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/src/lib.rs b/src/lib.rs
index d9dd423f..9d09ef51 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1063,27 +1063,19 @@ fn install_sigwinch_handler() {
     // See ReadConsoleInputW && WINDOW_BUFFER_SIZE_EVENT
 }
 
-#[cfg(test)]
+#[cfg(all(unix,test))]
 mod test {
     use std::io::Write;
     use line_buffer::LineBuffer;
     use history::History;
-    #[cfg(unix)]
     use completion::Completer;
     use State;
-    #[cfg(unix)]
     use super::Result;
     use tty::Handle;
 
-    #[cfg(unix)]
     fn default_handle() -> Handle {
         ()
     }
-    #[cfg(windows)]
-    fn default_handle() -> Handle {
-        ::std::ptr::null_mut()
-        // super::get_std_handle(super::STDOUT_FILENO).expect("Valid stdout")
-    }
 
     fn init_state<'out>(out: &'out mut Write,
                         line: &str,
@@ -1105,7 +1097,6 @@ mod test {
     }
 
     #[test]
-    #[cfg(unix)]
     fn edit_history_next() {
         let mut out = ::std::io::sink();
         let line = "current edited line";
@@ -1143,9 +1134,7 @@ mod test {
         assert_eq!(line, s.line.as_str());
     }
 
-    #[cfg(unix)]
     struct SimpleCompleter;
-    #[cfg(unix)]
     impl Completer for SimpleCompleter {
         fn complete(&self, line: &str, _pos: usize) -> Result<(usize, Vec<String>)> {
             Ok((0, vec![line.to_string() + "t"]))
@@ -1153,7 +1142,6 @@ mod test {
     }
 
     #[test]
-    #[cfg(unix)]
     fn complete_line() {
         use consts::KeyPress;
         use tty::RawReader;
-- 
GitLab