You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a structure that accepts Bitflags for a flags field. And it works beautifully well except in the case of wanting to use just one flag:
// OKlet a = MyStruct::new(MyEnum::Flag1 | MyEnum::Flag2);// Failslet b = MyStruct::new(MyEnum::Flag1);// ^^^^^^^^^^^^^ expected struct `enumflags2::BitFlags`, found enum `mycrate::MyEnum`// the ugly solution let b = MyStruct::new(enumflags2::BitFlags::from(MyEnum::Flag1));
Do you happen know of a more ergonomic way for the user to provide just one flag? Thank you