From f44f8fe94268ff9262fa43e015c7a7bc44686191 Mon Sep 17 00:00:00 2001 From: dbr Date: Fri, 13 Jan 2023 14:06:44 +1030 Subject: [PATCH] Mark Key, StyleColor, StyleVar as non-exhaustive Likely to have new things added - rest are all either fairly closed sets of things (up/down/left/right) or likely to require some intentional change from user (e.g DrawCmd) Closes #695 --- imgui/src/input/keyboard.rs | 1 + imgui/src/style.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/imgui/src/input/keyboard.rs b/imgui/src/input/keyboard.rs index 91f20bd..9a2ccb1 100644 --- a/imgui/src/input/keyboard.rs +++ b/imgui/src/input/keyboard.rs @@ -5,6 +5,7 @@ use crate::Ui; #[repr(u32)] #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] #[allow(missing_docs)] // Self-describing +#[non_exhaustive] pub enum Key { Tab = sys::ImGuiKey_Tab, LeftArrow = sys::ImGuiKey_LeftArrow, diff --git a/imgui/src/style.rs b/imgui/src/style.rs index f6effbf..d2b5d1f 100644 --- a/imgui/src/style.rs +++ b/imgui/src/style.rs @@ -212,6 +212,7 @@ impl IndexMut for Style { /// [`crate::Ui::show_demo_window`] until you spot it #[repr(u32)] #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] +#[non_exhaustive] pub enum StyleColor { /// Default color of text througout application Text = sys::ImGuiCol_Text, @@ -500,6 +501,7 @@ impl std::error::Error for InvalidStyleColorValue {} /// A temporary change in user interface style #[derive(Copy, Clone, Debug, PartialEq)] +#[non_exhaustive] pub enum StyleVar { /// Global alpha applies to everything Alpha(f32),