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 {