linebender / druid

A data-first Rust-native UI design toolkit.
https://linebender.org/druid/
Apache License 2.0
9.53k stars 569 forks source link

AppLauncher::configure_env should take FnOnce #2053

Open Janrupf opened 2 years ago

Janrupf commented 2 years ago

Description

Currently it is not possible to move values into the closure used by AppLauncher::configure_env. This is a problem when you want to do some one-time setup on the closure which requires moving outer values.

Proposed solution

AppLauncher::configure_env should take a FnOnce. Since this function is only used once when calling AppLauncher::launch, which already takes mut self by value, this shouldn't break anything.

cmyr commented 2 years ago

I agree that this sounds right.