#Option inside Bundle struct complains about trait bounds

1 messages · Page 1 of 1 (latest)

stray harbor
#

Hi, I've got a Bundle containing an Option<Clickable> where Clickable is an enum that derives Component. The compiler is complaining about Option<Clickable> not implementing Component. I had the same issue when I was trying to query Option<Clickable>, but this was mitigated by simply referencing Clickable (so Option<&Clickable>. I feel like creating a wrapper type for this isn't the best way around this (and wouldn't it have the same issue?), so does anyone have any tips?

vagrant basalt
#

What would a bundle with a Option type do?

#

insert nothing if its None?

stray harbor
#

Yep

#

Previously I had a Nothing inside the enum but it felt redundant so I'm trying the Option route

vagrant basalt
#

i dont think thats implemente

#

in fact

#

its a open issue

stray harbor
#

Woah google

stray harbor
wooden grail
#

@stray harbor fwiw for things like this.. I add/remove components as necessary. So either it's clickable or it isn't and it isn't clickable if the component is removed.

stray harbor
#

...i don't know why i didn't think of this LOL

#

ill do that, that makes a lot more sense