Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier AttributeSet creation #49

Closed
Yamakaky opened this issue Aug 9, 2021 · 2 comments
Closed

Easier AttributeSet creation #49

Yamakaky opened this issue Aug 9, 2021 · 2 comments

Comments

@Yamakaky
Copy link

Yamakaky commented Aug 9, 2021

Currently, to create an AttributeSet, we need to do a list on .insert or a loop. It would be nice to be able to do it via a constructor, for example AttributeSet::with_values(&[Key::BTN_A, Key::BTN_B]).

@StephanvanSchaik
Copy link
Contributor

It is currently possible to create an AttributeSet from an array/iterator like in the following example:

let keys = AttributeSet::from_iter([Key::BTN_A, Key::BTN_B]);

@Yamakaky
Copy link
Author

Yamakaky commented Aug 1, 2022

Thanks, maybe it was added in the mean time !

@Yamakaky Yamakaky closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants