Skip to content

Allow dynamic LabelText closure to return different types#2064

Merged
maan2003 merged 2 commits intolinebender:masterfrom
jplatte:generic-dynamic-label-text
Dec 3, 2021
Merged

Allow dynamic LabelText closure to return different types#2064
maan2003 merged 2 commits intolinebender:masterfrom
jplatte:generic-dynamic-label-text

Conversation

@jplatte
Copy link
Member

@jplatte jplatte commented Dec 2, 2021

This should decrease copying (especially if the user-provided closure returns Arc<str> or something that can be converted to it without copying) and make comparisons in resolve faster.

@jplatte
Copy link
Member Author

jplatte commented Dec 2, 2021

CI failure looks unrelated.

@maan2003
Copy link
Collaborator

maan2003 commented Dec 2, 2021

rebase should fix CI

Copy link
Collaborator

@maan2003 maan2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jplatte
Copy link
Member Author

jplatte commented Dec 2, 2021

Oh, CI failure is related. I'll update the examples tomorrow.

@jpochyla
Copy link
Contributor

jpochyla commented Dec 2, 2021

I think one downside is that dynamics will often return format!()ted strings, and that would have to reallocate.

@maan2003
Copy link
Collaborator

maan2003 commented Dec 3, 2021

I think one downside is that dynamics will often return format!()ted strings, and that would have to reallocate.

This already happens right? We always store data as Arc<str>

@jplatte
Copy link
Member Author

jplatte commented Dec 3, 2021

Updated the one example affected by this and added a changelog entry.

@maan2003 maan2003 merged commit c6040da into linebender:master Dec 3, 2021
@jplatte jplatte deleted the generic-dynamic-label-text branch December 3, 2021 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants