Make toggle method accept impl Into<Option<bool>> (#3446)

This PR makes the `toggle` method on the various list components accept
an `impl Into<Option<bool>>` instead of just an `Option<bool>`.

This allows a caller with just a `bool` avoid having to wrap the
`Option` themselves.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-11-29 16:13:41 -05:00 committed by GitHub
parent fb377aed73
commit df5de47a78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 11 deletions

View file

@ -2505,7 +2505,7 @@ impl CollabPanel {
.when_some(button, |el, button| el.right_button(button))
.selected(is_selected)
.when(can_collapse, |el| {
el.toggle(Some(is_collapsed)).on_toggle(
el.toggle(is_collapsed).on_toggle(
cx.listener(move |this, _, cx| this.toggle_section_expanded(section, cx)),
)
});