Skip to content
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

implement From<String> for Element #2448

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JL710
Copy link
Contributor

@JL710 JL710 commented May 22, 2024

This PR adds a From<String> implemenation for Element.

This works:

widget::button("")

This did not work:

widget::button(String::new())

You needed this:

widget::button(widget::text(String::new()))

This PR makes it a lot less redundant if you want have format! generated text in a button.

@derezzedex
Copy link
Member

derezzedex commented May 22, 2024

this PR #2338 might interest you, it's a text macro analogous to the format macro.

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.

None yet

2 participants