From 28ca4e2959180ab69664b2e3b8abdb78de8cea97 Mon Sep 17 00:00:00 2001 From: Kogia-sima Date: Mon, 28 Dec 2020 21:28:53 +0900 Subject: [PATCH] doc: fix examples in doc comments --- sailfish/src/runtime/filter.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sailfish/src/runtime/filter.rs b/sailfish/src/runtime/filter.rs index b79bbe9..82a2447 100644 --- a/sailfish/src/runtime/filter.rs +++ b/sailfish/src/runtime/filter.rs @@ -1,7 +1,5 @@ //! Build-in filters -// TODO: performance improvement - use std::fmt; use std::ptr; @@ -52,7 +50,7 @@ impl<'a, T: fmt::Debug> Render for Debug<'a, T> { /// ``` /// /// ```text -/// table content: <%= format!("{:?}", table); %> +/// table content: <%= format!("{:?}", table) %> /// ``` #[inline] pub fn dbg(expr: &T) -> Debug { @@ -260,7 +258,13 @@ fn truncate_impl( /// The following example renders the first 20 characters of `message` /// /// ```test -/// <%= message | truncate(20) %> +/// <%= "Hello, world!" | truncate(5) %> +/// ``` +/// +/// result: +/// +/// ```text +/// Hello... /// ``` #[inline] pub fn truncate(expr: &T, limit: usize) -> Truncate {