Conversation
luleyleo
reviewed
May 29, 2020
Collaborator
luleyleo
left a comment
There was a problem hiding this comment.
I don't get why the lifetime is no longer needed but it looks like a nice change.
CHANGELOG.md
Outdated
| - Replaced `Command::one_shot` and `::take_object` with a `SingleUse` payload wrapper type. ([#959] by [@finnerale]) | ||
| - Renamed `WidgetPod` methods: `paint` to `paint_raw`, `paint_with_offset` to `paint`, `paint_with_offset_always` to `paint_always`. ([#980] by [@totsteps]) | ||
| - `Command` and `Selector` have been reworked and are now statically typed, similarly to `Env` and `Key`. ([#993] by [@finnerale]) | ||
| - Standardize the type returned by the contexts' `text()` methods. (#[996] by |
A long standing pet-peeve of mine: Previously there were a number of different lifetypes associated with the text factory depending on where it came from. This standardizes that, so that all contexts' text() method returns an owned PietText handle. This has the added advantage of getting rid of the weird lifetime in LayoutContext, which will also unblock my macro work.
Member
Author
|
as far as I understand the reason we needed the lifetime previously is because we held onto a reference to the type, and so we had to be explicit about its inner lifetime; but now that we just hand one out (not a reference) we can elide it? Still feels weird though |
luleyleo
approved these changes
May 29, 2020
Collaborator
luleyleo
left a comment
There was a problem hiding this comment.
It's odd but I like it a lot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A long standing pet-peeve of mine: Previously there were a
number of different lifetypes associated with the text factory
depending on where it came from.
This standardizes that, so that all contexts' text() method returns
an owned PietText handle.
This has the added advantage of getting rid of the weird lifetime
in LayoutContext, which will also unblock my macro work.
This is a breaking change in a fairly minor way;
LayoutCtxreturnsTextnow instead of&mut Text.