From a350e8dcd8cfb4769e32562b05503f5b33cae1be Mon Sep 17 00:00:00 2001 From: dbr Date: Wed, 27 Oct 2021 23:26:46 +1100 Subject: [PATCH] fmt --- imgui-sys/build.rs | 5 +---- imgui/src/io.rs | 11 ++++++----- imgui/src/stacks.rs | 4 +--- imgui/src/widget/selectable.rs | 5 ++++- imgui/src/window/content_region.rs | 4 +++- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/imgui-sys/build.rs b/imgui-sys/build.rs index 30e3934..e3a56fe 100644 --- a/imgui-sys/build.rs +++ b/imgui-sys/build.rs @@ -73,10 +73,7 @@ fn main() -> io::Result<()> { build.flag("-fno-exceptions").flag("-fno-rtti"); } // TODO: disable linking C++ stdlib? Not sure if it's allowed. - build - .warnings(false) - .file(imgui_cpp) - .compile("libcimgui.a"); + build.warnings(false).file(imgui_cpp).compile("libcimgui.a"); } Ok(()) } diff --git a/imgui/src/io.rs b/imgui/src/io.rs index 4d73efa..5773d66 100644 --- a/imgui/src/io.rs +++ b/imgui/src/io.rs @@ -233,9 +233,10 @@ pub struct Io { pub(crate) set_clipboard_text_fn: Option, pub(crate) clipboard_user_data: *mut c_void, - #[cfg(not(feature="docking"))] - ime_set_input_screen_pos_fn: Option, - #[cfg(not(feature="docking"))] + #[cfg(not(feature = "docking"))] + ime_set_input_screen_pos_fn: + Option, + #[cfg(not(feature = "docking"))] ime_window_handle: *mut c_void, /// Mouse position, in pixels. /// @@ -480,9 +481,9 @@ fn test_io_memory_layout() { assert_field_offset!(get_clipboard_text_fn, GetClipboardTextFn); assert_field_offset!(set_clipboard_text_fn, SetClipboardTextFn); assert_field_offset!(clipboard_user_data, ClipboardUserData); - #[cfg(not(feature="docking"))] + #[cfg(not(feature = "docking"))] assert_field_offset!(ime_set_input_screen_pos_fn, ImeSetInputScreenPosFn); - #[cfg(not(feature="docking"))] + #[cfg(not(feature = "docking"))] assert_field_offset!(ime_window_handle, ImeWindowHandle); assert_field_offset!(mouse_pos, MousePos); assert_field_offset!(mouse_down, MouseDown); diff --git a/imgui/src/stacks.rs b/imgui/src/stacks.rs index 7c587e9..90efbd9 100644 --- a/imgui/src/stacks.rs +++ b/imgui/src/stacks.rs @@ -161,9 +161,7 @@ unsafe fn push_style_var(style_var: StyleVar) { } IndentSpacing(v) => igPushStyleVarFloat(sys::ImGuiStyleVar_IndentSpacing as i32, v), ScrollbarSize(v) => igPushStyleVarFloat(sys::ImGuiStyleVar_ScrollbarSize as i32, v), - ScrollbarRounding(v) => { - igPushStyleVarFloat(sys::ImGuiStyleVar_ScrollbarRounding as i32, v) - } + ScrollbarRounding(v) => igPushStyleVarFloat(sys::ImGuiStyleVar_ScrollbarRounding as i32, v), GrabMinSize(v) => igPushStyleVarFloat(sys::ImGuiStyleVar_GrabMinSize as i32, v), GrabRounding(v) => igPushStyleVarFloat(sys::ImGuiStyleVar_GrabRounding as i32, v), TabRounding(v) => igPushStyleVarFloat(sys::ImGuiStyleVar_TabRounding as i32, v), diff --git a/imgui/src/widget/selectable.rs b/imgui/src/widget/selectable.rs index 6b89bb5..062dd9f 100644 --- a/imgui/src/widget/selectable.rs +++ b/imgui/src/widget/selectable.rs @@ -59,7 +59,10 @@ pub struct Selectable<'ui, T> { impl<'ui, T: AsRef> Selectable<'ui, T> { /// Constructs a new selectable builder. #[doc(alias = "Selectable")] - #[deprecated(since = "0.9.0", note = "use `ui.selectable` or `ui.selectable_config`")] + #[deprecated( + since = "0.9.0", + note = "use `ui.selectable` or `ui.selectable_config`" + )] pub fn new(label: T, ui: &'ui Ui) -> Self { Selectable { label, diff --git a/imgui/src/window/content_region.rs b/imgui/src/window/content_region.rs index c43c1f5..e9bef82 100644 --- a/imgui/src/window/content_region.rs +++ b/imgui/src/window/content_region.rs @@ -36,7 +36,9 @@ impl Ui { out.into() } #[doc(alias = "GetContentRegionWidth")] - #[deprecated(note = "Removed in Dear ImGui 1.85, 'not very useful in practice' and can be done with window_content_region_min/_max")] + #[deprecated( + note = "Removed in Dear ImGui 1.85, 'not very useful in practice' and can be done with window_content_region_min/_max" + )] pub fn window_content_region_width(&self) -> f32 { self.window_content_region_max()[0] - self.window_content_region_min()[0] }