Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Ui::columns_const()
(emilk#4764)
# Changes - Adds a new function `egui::Ui::columns_const()`, which is the same as `egui::Ui::columns()` except that it uses a `const` parameter for the column count. - Backed by an array `[Ui; NUM_COL] instead of a `Vec<Ui>`, so fewer allocations - Inner closure takes in an array reference, instead of a slice reference. This makes it possible to use pattern destructuring on the columns, as shown in the example, and makes it more ergonomic to use # Example ```rust // ORIGINAL ui.columns(2, |cols| { cols[0].label("one"); cols[1].label("two"); }); // NEW ui.columns_const(|[a,b]| { a.label("one"); b.label("two"); }); ``` # Checks - [X] `cargo fmt` - [X] `cargo clippy` - [X] `./scripts/check.sh` - [X] Docs - [ ] Review
- Loading branch information