-
Notifications
You must be signed in to change notification settings - Fork 569
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
Remove Env::default #1837
Remove Env::default #1837
Conversation
Yes this sounds good. Give me a few days to get back into this. |
druid/src/theme.rs
Outdated
@@ -186,5 +186,5 @@ pub(crate) fn add_to_env(env: Env) -> Env { | |||
|
|||
#[deprecated(since = "0.7.0", note = "use Env::default() instead")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also change the note to following
#[deprecated(since = "0.7.0", note = "use Env::with_default_i10n() instead")]
or Env::empty()
. You know best :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just remove this? I don't think this is a popular function 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, there's no good way to use this right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Merging in a few days unless someone objects.
This was a bit of a footgun; it would always configure localization resources, which doesn't make sense if we want to use an `Env` as just a bag of key/values in some contexts. Specifically, we may want to do this for #1658. The fix is a two-parter: - the `LocalizationManager` owned by the env is now optional, although it is expected to exist for the root env. The framework makes sure this is the case. - There is a new `Env::empty` method that creates a new empty environment, with no localization resources. This is suitable for the 'specifying overrides' case.
This was a bit of a footgun; it would always configure localization
resources, which doesn't make sense if we want to use an
Env
as just abag of key/values in some contexts.
Specifically, we may want to do this for #1658.
The fix is a two-parter:
LocalizationManager
owned by the env is now optional, althoughit is expected to exist for the root env. The framework makes sure this
is the case.
Env::empty
method that creates a new emptyenvironment, with no localization resources. This is suitable for the
'specifying overrides' case.
@arthmis if you're still interested in finishing up #1658, then I would merge this as is, but if that is in doubt I would probably remove the
empty()
method since it isn't really useful anywhere else I can think of?