diff --git a/rinja/src/lib.rs b/rinja/src/lib.rs index 0c08273e..ecc4273b 100644 --- a/rinja/src/lib.rs +++ b/rinja/src/lib.rs @@ -202,11 +202,13 @@ pub trait DynTemplate { } impl DynTemplate for T { + #[inline] #[cfg(feature = "alloc")] fn dyn_render(&self) -> Result { ::render(self) } + #[inline] fn dyn_render_into(&self, writer: &mut dyn fmt::Write) -> Result<()> { ::render_into(self, writer) } @@ -217,12 +219,14 @@ impl DynTemplate for T { ::write_into(self, writer) } + #[inline] fn size_hint(&self) -> usize { - Self::SIZE_HINT + ::SIZE_HINT } } impl fmt::Display for dyn DynTemplate { + #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.dyn_render_into(f).map_err(|_| fmt::Error {}) }