Skip to content

Commit

Permalink
Document that std::fmt::Display is used first
Browse files Browse the repository at this point in the history
Closes #363
  • Loading branch information
lambda-fairy authored Apr 16, 2023
1 parent 7233cda commit 0d1bc32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/content/render-trait.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# The `Render` trait

Maud uses the [`Render`][Render] trait to convert [`(spliced)`](splices-toggles.md) values to HTML.
This is implemented for many Rust primitive types (`&str`, `i32`) by default, but you can implement it for your own types as well.
For most types, Maud will use the [`std::fmt::Display`][Display] trait to convert [`(spliced)`](splices-toggles.md) values to HTML.
(The result will be escaped automatically.)
If you'd like to override this behavior for your own type, then you can implement the [`Render`][Render] trait instead.

Below are some examples of implementing `Render`.
Feel free to use these snippets in your own project!
Expand Down

0 comments on commit 0d1bc32

Please sign in to comment.