From 0a974d8f1dc85b89ebf0ef3bd1e7b31cccc658dd Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 8 Feb 2025 14:03:27 +0100 Subject: [PATCH] clippy fix --- src/execute.rs | 12 ++++++------ src/main.rs | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/execute.rs b/src/execute.rs index 8301470..bbad4ed 100644 --- a/src/execute.rs +++ b/src/execute.rs @@ -15,17 +15,17 @@ pub fn execute_mode(mode: Mode, connection: Connection) { fn pixels(connection: &Connection, pixel_command: PixelCommand) { match pixel_command { - PixelCommand::Reset => pixels_reset(&connection), + PixelCommand::Reset => pixels_reset(connection), } } fn brightness(connection: &Connection, brightness_command: BrightnessCommand) { match brightness_command { - BrightnessCommand::Reset => brightness_reset(&connection), - BrightnessCommand::Min => brightness_set(&connection, Brightness::MIN), - BrightnessCommand::Max => brightness_set(&connection, Brightness::MAX), + BrightnessCommand::Reset => brightness_reset(connection), + BrightnessCommand::Min => brightness_set(connection, Brightness::MIN), + BrightnessCommand::Max => brightness_set(connection, Brightness::MAX), BrightnessCommand::Set { brightness } => { - brightness_set(&connection, Brightness::saturating_from(brightness)) + brightness_set(connection, Brightness::saturating_from(brightness)) } } } @@ -44,7 +44,7 @@ fn brightness_reset(connection: &Connection) { info!("Reset brightness"); } -fn brightness_set(connection: &&Connection, brightness: Brightness) { +fn brightness_set(connection: &Connection, brightness: Brightness) { connection .send(Command::Brightness(brightness)) .expect("Failed to set brightness"); diff --git a/src/main.rs b/src/main.rs index d0f23d7..cb6515a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,7 +18,7 @@ fn main() { } fn make_connection(destination: String, transport: Protocol) -> Connection { - let connection = match transport { + match transport { Protocol::Udp => Connection::open(destination).expect("Failed to open UDP connection"), Protocol::WebSocket => { let url = destination.parse().expect( @@ -27,8 +27,7 @@ fn make_connection(destination: String, transport: Protocol) -> Connection { Connection::open_websocket(url).expect("Failed to open WebSocket connection") } Protocol::Fake => Connection::Fake, - }; - connection + } } fn init_logging(debug: bool) {