anp / moxie

lightweight platform-agnostic tools for declarative UI
https://moxie.rs
Apache License 2.0
827 stars 27 forks source link

Skip formatting machinery in text nodes without format args #274

Open anp opened 3 years ago

anp commented 3 years ago

https://github.com/anp/moxie/blob/main/dom/src/interfaces/node.rs#L65

https://doc.rust-lang.org/stable/std/fmt/struct.Arguments.html#method.as_str is stable as of 1.53.

zetanumbers commented 3 years ago

So um, this method is useful if format_args! has no args. Btw i think we could use .to_string() or thread local buffer for this.