diff --git a/examples/cursor/mod.rs b/examples/cursor/mod.rs index 685b89e..fea8218 100644 --- a/examples/cursor/mod.rs +++ b/examples/cursor/mod.rs @@ -21,7 +21,7 @@ pub fn pos() { let screen = Screen::default(); let mut cursor = cursor(&screen); // get the cursor position. - let (x, y) = cursor.pos(); + let (_x, _y) = cursor.pos(); } /// Move the cursor 3 up | demonstration. diff --git a/examples/input/keyboard/async_input.rs b/examples/input/keyboard/async_input.rs index d0751c4..357e970 100644 --- a/examples/input/keyboard/async_input.rs +++ b/examples/input/keyboard/async_input.rs @@ -21,7 +21,7 @@ pub fn read_async_until() { let mut stdin = input.read_until_async(b'\r').bytes(); - for i in 0..100 { + for _i in 0..100 { terminal.clear(ClearType::All); cursor.goto(1, 1); let a = stdin.next(); @@ -49,7 +49,7 @@ pub fn read_async() { let mut stdin = input.read_async().bytes(); - for i in 0..100 { + for _i in 0..100 { let a = stdin.next(); println!("pressed key: {:?}", a); diff --git a/examples/program_examples/command_bar.rs b/examples/program_examples/command_bar.rs index 3afd0d5..592650c 100644 --- a/examples/program_examples/command_bar.rs +++ b/examples/program_examples/command_bar.rs @@ -35,7 +35,7 @@ fn main() { { input_buf.lock().unwrap().clear(); } - Some(Ok(val)) => + Some(Ok(_val)) => { input_buf.lock().unwrap().push(a.unwrap().unwrap() as char); } @@ -65,7 +65,7 @@ fn log(input_buf: Arc>, screen: &Screen) -> Vec (SyncFlagTx, SyncFlagRx) { fn main() { - let (results_tx, results_rx): (Sender, Receiver) = mpsc::channel(); + let (_results_tx, _results_rx): (Sender, Receiver) = mpsc::channel(); let (mut more_jobs_tx, more_jobs_rx) = new_sync_flag(true); // queue with all log entry's. let queue = WorkQueue::new(); // queue x logs with different threads. - let thread_handles = log_with_different_threads(more_jobs_tx.clone(), queue.clone()); + let _thread_handles = log_with_different_threads(more_jobs_tx.clone(), queue.clone()); // a thread that will log all logs in the queue. handle_incoming_logs(more_jobs_rx.clone(), queue.clone()); diff --git a/examples/some_types/mod.rs b/examples/some_types/mod.rs index 4bf7b21..0e644bf 100644 --- a/examples/some_types/mod.rs +++ b/examples/some_types/mod.rs @@ -12,10 +12,10 @@ pub fn use_crossterm_cursor() let crossterm = Crossterm::new(&screen); // pass a reference to the current screen. - let cursor = crossterm.cursor(); - let color = crossterm.color(); - let terminal = crossterm.terminal(); - let style = crossterm.style("").with(Color::Black).on(Color::Green); + let _cursor = crossterm.cursor(); + let _color = crossterm.color(); + let _terminal = crossterm.terminal(); + let _style = crossterm.style("").with(Color::Black).on(Color::Green); // perform some actions with the instances above. } diff --git a/src/common/functions.rs b/src/common/functions.rs index aaa9be9..bca4c9e 100644 --- a/src/common/functions.rs +++ b/src/common/functions.rs @@ -21,7 +21,7 @@ pub fn get_terminal_size() -> (u16, u16) { } /// Get the cursor position based on the current platform. -pub fn get_cursor_position(stdout: &Arc) -> (u16, u16) { +pub fn get_cursor_position(_stdout: &Arc) -> (u16, u16) { #[cfg(unix)] return pos().expect("Valide position"); // return pos().unwrap_or_else(|x| { return (0,0) }); diff --git a/src/common/screen/raw.rs b/src/common/screen/raw.rs index 9796001..d5b4ea2 100644 --- a/src/common/screen/raw.rs +++ b/src/common/screen/raw.rs @@ -32,7 +32,7 @@ impl RawScreen { #[cfg(target_os = "windows")] let mut command = win_commands::RawModeCommand::new(); - let result = command.enable(); + let _result = command.enable(); Ok(()) } diff --git a/src/kernel/unix_kernel/terminal.rs b/src/kernel/unix_kernel/terminal.rs index 35b8fe2..5cbecc3 100644 --- a/src/kernel/unix_kernel/terminal.rs +++ b/src/kernel/unix_kernel/terminal.rs @@ -73,7 +73,7 @@ pub fn terminal_size() -> (u16, u16) { pub fn pos() -> io::Result<(u16, u16)> { - let screen = Screen::new(false); + let _screen = Screen::new(false); // if we enable raw modes with screen, this could cause problems if raw mode is already enabled in applicaition. // I am not completely happy with this approach so feel free to find an other way. @@ -226,7 +226,7 @@ pub fn disable_raw_mode() -> io::Result<()> pub fn get_tty() -> io::Result { let mut tty_f: fs::File = unsafe { ::std::mem::zeroed() }; - let fd = unsafe { + let _fd = unsafe { if libc::isatty(libc::STDIN_FILENO) == 1 { libc::STDIN_FILENO } else { diff --git a/src/modules/input/unix_input.rs b/src/modules/input/unix_input.rs index c1bb4ee..fd61a22 100644 --- a/src/modules/input/unix_input.rs +++ b/src/modules/input/unix_input.rs @@ -15,7 +15,7 @@ impl UnixInput { } impl ITerminalInput for UnixInput { - fn read_line(&self, screen_manger: &Arc) -> io::Result { + fn read_line(&self, _screen_manger: &Arc) -> io::Result { let mut rv = String::new(); io::stdin().read_line(&mut rv)?; let len = rv.trim_right_matches(&['\r', '\n'][..]).len(); @@ -23,11 +23,11 @@ impl ITerminalInput for UnixInput { Ok(rv) } - fn read_char(&self, screen_manger: &Arc) -> io::Result { + fn read_char(&self, _screen_manger: &Arc) -> io::Result { read_char() } - fn read_async(&self, screen_manger: &Arc) -> AsyncReader { + fn read_async(&self, _screen_manger: &Arc) -> AsyncReader { let (send, recv) = mpsc::channel(); thread::spawn(move || { @@ -41,7 +41,7 @@ impl ITerminalInput for UnixInput { AsyncReader { recv: recv } } - fn read_until_async(&self, delimiter: u8, screen_manger: &Arc) -> AsyncReader { + fn read_until_async(&self, delimiter: u8, _screen_manger: &Arc) -> AsyncReader { let (send, recv) = mpsc::channel(); thread::spawn(move || { diff --git a/src/modules/output/test.rs b/src/modules/output/test.rs index e9d9d92..020d7e0 100644 --- a/src/modules/output/test.rs +++ b/src/modules/output/test.rs @@ -36,7 +36,7 @@ mod winapi_tests { #[test] fn write_ansi() { - let screen = Screen::default(); + let _screen = Screen::default(); let output = AnsiOutput::new(); let bytes = "test".as_bytes(); @@ -47,7 +47,7 @@ fn write_ansi() #[test] fn write_str_ansi() { - let screen = Screen::default(); + let _screen = Screen::default(); let output = AnsiOutput::new(); let bytes = "test".as_bytes(); diff --git a/src/modules/style/styledobject.rs b/src/modules/style/styledobject.rs index 23396da..3d99215 100644 --- a/src/modules/style/styledobject.rs +++ b/src/modules/style/styledobject.rs @@ -216,7 +216,7 @@ impl <'a, D: Display + 'a> DisplayableObject<'a, D> impl<'a, D: Display + 'a> Display for DisplayableObject<'a, D> { - fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { + fn fmt(&self, _f: &mut Formatter) -> Result<(), Error> { self.styled_object.paint(&self.screen); return Ok(()) } diff --git a/src/modules/terminal/ansi_terminal.rs b/src/modules/terminal/ansi_terminal.rs index 32f5241..ed7b599 100644 --- a/src/modules/terminal/ansi_terminal.rs +++ b/src/modules/terminal/ansi_terminal.rs @@ -36,7 +36,7 @@ impl ITerminal for AnsiTerminal { }; } - fn terminal_size(&self, stdout: &Arc) -> (u16, u16) { + fn terminal_size(&self, _stdout: &Arc) -> (u16, u16) { functions::get_terminal_size() }