From 0d1bc320d39c713cad8607b12a177dd30f9722dd Mon Sep 17 00:00:00 2001 From: Chris Wong <lambda.fairy@gmail.com> Date: Sun, 16 Apr 2023 15:18:36 +1000 Subject: [PATCH] Document that std::fmt::Display is used first Closes #363 --- docs/content/render-trait.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/content/render-trait.md b/docs/content/render-trait.md index cae04bb..2f536ff 100644 --- a/docs/content/render-trait.md +++ b/docs/content/render-trait.md @@ -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!