Closed
Description
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:
// OK
let a = MyStruct::new(MyEnum::Flag1 | MyEnum::Flag2);
// Fails
let 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