mirror of https://github.com/wayvr-org/wayvr.git
no num_enum
This commit is contained in:
parent
c3cbc43f6f
commit
62c210fc1d
|
|
@ -6603,7 +6603,6 @@ dependencies = [
|
|||
"image",
|
||||
"log",
|
||||
"lru",
|
||||
"num_enum",
|
||||
"ouroboros",
|
||||
"parking_lot",
|
||||
"regex",
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ image = {
|
|||
]
|
||||
}
|
||||
lru = "0.18.0"
|
||||
num_enum = "0.7.6" # for converting integers into Option enums (search for TryFromPrimitive in the codebase)
|
||||
ouroboros = "0.18.5"
|
||||
parking_lot = "0.12.5"
|
||||
resvg = { version = "0.47.0", default-features = false }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
use crate::drawing;
|
||||
use num_enum::TryFromPrimitive;
|
||||
use strum::EnumCount;
|
||||
use strum::{EnumCount, VariantArray};
|
||||
// Primary: button color
|
||||
// OnPrimary: text color placed on the Primary-colored button
|
||||
|
||||
#[derive(Debug, Copy, Clone, TryFromPrimitive, EnumCount)]
|
||||
#[derive(Debug, Copy, Clone, EnumCount, VariantArray)]
|
||||
#[repr(u8)]
|
||||
pub enum WguiColorName {
|
||||
Primary,
|
||||
|
|
@ -78,7 +77,7 @@ impl WguiColorPalette {
|
|||
fn resolve_name(&self, in_name: &str) -> Option<WguiColorName> {
|
||||
for (idx, (_, name)) in self.colors.iter().enumerate() {
|
||||
if in_name == *name {
|
||||
return WguiColorName::try_from(idx as u8).ok();
|
||||
return WguiColorName::VARIANTS.get(idx).copied();
|
||||
}
|
||||
}
|
||||
None
|
||||
|
|
|
|||
Loading…
Reference in New Issue