4 ms·
I like the use of "unsafe" for something that you don't want to reach for first. Those who are new get a very clear warning and those who aren't have had the op
by vkjv 8y ago
I like the use of "unsafe" for something that you don't want to reach for first. Those who are new get a very clear warning and those who aren't have had the opportunity to understand the nuances.
React uses the term "danger" to express a similar concept. You are trusting this value to already have been sanitized / escaped.
https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml https://reactjs.org/docs/dom-elements.html#dangerouslysetinn...
¯\_(ツ)_/¯ I don't actually feel that strongly about a keyword that is used sparingly.
Aside: Thanks for everything you do for Rust and the community!
- steveklabnik 8y agoYou’re welcome!
- moosingin3space 8y agoI think "unsafe" was a good name. Rails ERB templates use the `html_safe` name for something that the author knows to be HTML-safe, which is confusingly-named, implying that using `html_safe` makes something HTML-safe.