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

Closed
wants to merge 1 commit into 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.

@JL710
Copy link
Contributor Author

JL710 commented Jul 12, 2024

Awesome macro. I will replace abount 100 occourences in my code with it.

@hecrj hecrj added this to the 0.13 milestone Sep 10, 2024
@hecrj hecrj added feature New feature or request widget addition labels Sep 10, 2024
@hecrj
Copy link
Member

hecrj commented Sep 10, 2024

It's unclear when this From implementation may be useful; so I am closing this in favor of the new text! macro introduced in #2338.

@hecrj hecrj closed this Sep 10, 2024
@JL710 JL710 deleted the From<String>-for-Element branch January 17, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition feature New feature or request widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants