From 4468126d48f012b21c5d2e09a28d5137c8ee407b Mon Sep 17 00:00:00 2001 From: gwenn Date: Mon, 2 Oct 2023 16:43:05 +0200 Subject: [PATCH] Fix clippy warnings on Windows --- src/tty/windows.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tty/windows.rs b/src/tty/windows.rs index 1bd7aa314..296e83df3 100644 --- a/src/tty/windows.rs +++ b/src/tty/windows.rs @@ -6,6 +6,7 @@ use std::io; use std::mem; use std::os::windows::io::IntoRawHandle; use std::ptr; +use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::{sync_channel, Receiver, SyncSender}; use std::sync::Arc; @@ -104,11 +105,11 @@ impl RawMode for ConsoleMode { pub struct ConsoleRawReader { conin: HANDLE, // external print reader - pipe_reader: Option>, + pipe_reader: Option>, } impl ConsoleRawReader { - fn create(conin: HANDLE, pipe_reader: Option>) -> ConsoleRawReader { + fn create(conin: HANDLE, pipe_reader: Option>) -> ConsoleRawReader { ConsoleRawReader { conin, pipe_reader } } @@ -581,7 +582,7 @@ fn write_all(handle: HANDLE, mut data: &[u16]) -> Result<()> { ) })?; if written == 0 { - return Err(Error::new(ErrorKind::WriteZero, "WriteConsoleW"))?; + Err(Error::new(ErrorKind::WriteZero, "WriteConsoleW"))?; } data = &data[(written as usize)..]; } @@ -603,7 +604,7 @@ pub struct Console { bell_style: BellStyle, raw_mode: Arc, // external print reader - pipe_reader: Option>, + pipe_reader: Option>, // external print writer pipe_writer: Option>, } @@ -810,7 +811,7 @@ impl Term for Console { } let (sender, receiver) = sync_channel(1); - let reader = Arc::new(AsyncPipe { + let reader = Rc::new(AsyncPipe { event: Handle(event), receiver, });