flagset icon indicating copy to clipboard operation
flagset copied to clipboard

Is there an ergonomic way to make Flagset<T> from Vec<T>?

Open 3tilley opened this issue 2 years ago • 1 comments

Hello,

I'm a Rust newbie so apologies if this is more a language question than one for your crate, but am I missing an ergonomic way of taking a vec/iterable/arr/slice of T and making it into FlagSet<T>?

I've taken inspiration from what someone did here here and made a free function, but just wanted to know if I was missing something obvious.

There is a line here which hints why you might want to make your own container, but tbh I didn't really understand the tradeoffs. Is there something special on function APIs that means you wouldn't want to just use Flagset directly?

3tilley avatar Jan 14 '22 00:01 3tilley

I was just wondering something similar. It might be worth implementing Extend to be able to gather a collection of FlagSets into a single set. But I am also a bit new to this and am not sure. :slightly_smiling_face:

otrho avatar May 25 '22 07:05 otrho