From 414b1d2550084071846f22f9747bd4eff906f9c9 Mon Sep 17 00:00:00 2001 From: Haim Gelfenbeyn Date: Sat, 21 Oct 2023 18:02:49 -0400 Subject: [PATCH] Keep rustfmt happy --- examples/list.rs | 5 ++--- rustfmt.toml | 2 +- src/iokit/display.rs | 2 +- src/iokit/io2c_interface.rs | 2 +- src/monitor.rs | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/list.rs b/examples/list.rs index 1741728..28b99ed 100644 --- a/examples/list.rs +++ b/examples/list.rs @@ -5,8 +5,7 @@ use ddc::Ddc; use ddc_macos::Monitor; fn main() { - let monitors = Monitor::enumerate() - .expect("Could not enumerate external monitors"); + let monitors = Monitor::enumerate().expect("Could not enumerate external monitors"); if monitors.is_empty() { println!("No external monitors found"); @@ -34,4 +33,4 @@ fn main() { } } } -} \ No newline at end of file +} diff --git a/rustfmt.toml b/rustfmt.toml index c1a42eb..481ef24 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,3 +1,3 @@ max_width = 120 -edition = "2018" +edition = "2021" use_try_shorthand = true diff --git a/src/iokit/display.rs b/src/iokit/display.rs index 503b3c8..80259ed 100644 --- a/src/iokit/display.rs +++ b/src/iokit/display.rs @@ -1,4 +1,4 @@ -# ![allow(non_upper_case_globals,unused)] +#![allow(non_upper_case_globals, unused)] /// Selective translation of IOKit/graphics/IOGraphicsLib.h use core_foundation::dictionary::CFDictionaryRef; diff --git a/src/iokit/io2c_interface.rs b/src/iokit/io2c_interface.rs index ecce247..b3b41cd 100644 --- a/src/iokit/io2c_interface.rs +++ b/src/iokit/io2c_interface.rs @@ -1,4 +1,4 @@ -#![allow(non_camel_case_types,non_upper_case_globals,non_snake_case,unused)] +#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case, unused)] /// Translation of IOKit/i2c/IOI2CInterface.h extern crate io_kit_sys; diff --git a/src/monitor.rs b/src/monitor.rs index 6b274f6..0dde185 100644 --- a/src/monitor.rs +++ b/src/monitor.rs @@ -87,7 +87,7 @@ impl Monitor { let display = CGDisplay::new(display_id); let frame_buffer = Self::get_io_framebuffer_port(display)?; Some(Self::new(display, frame_buffer)) - }) + }) .collect(); Ok(monitors) } @@ -107,7 +107,7 @@ impl Monitor { let serial = self.monitor.serial_number(); match serial { 0 => None, - _ => Some(format!("{}", serial)) + _ => Some(format!("{}", serial)), } }