iced-rs / iced_aw

Additional widgets for the Iced GUI library
MIT License
467 stars 110 forks source link

Use IntoIterator instead of Vec for tabs #254

Closed barskern closed 4 months ago

barskern commented 4 months ago

I have an app where I create the list of tabs at runtime through the use of an iterator. The allocation of a Vec which is then immediately iterated upon seemed a bit wasteful. If there was a reason for the particular API, please do tell. If not, here is a simple change which changes the function to accept any IntoIterator, which would then avoid this allocation in my case. Further, the existing interface should be preserved, as Vec implements IntoIterator, in addition to that the size_hit will return the length of the Vec.

Thank you for a great couple of widgets in this library!