Ideas for DomBuilder::children() API #27
Closed
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.
Two ideas for
DomBuilder::children()
:Dom
, but more generallyInto<Dom>
, and then implementing the corresponding conversion forDomBuilder
?Change 1) would make it easier to make a "children" list of Dom elements from any iterator/collection. I'm often
collect()
ing toVec
, and then converting to a slice withas_mut_slice()
.Change 2) could be useful because it will allow to create Dom elements more easily without macros. For example:
Where
html()
is a function to create a DomBuilder like this:Of course I'm just opening this to get your opinion on these ideas, maybe there are good reasons why it's not that way?