mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-02 07:20:55 +00:00
Make simple forwarding methods #[inline]
This commit is contained in:
parent
64ad2424ce
commit
a4527b8424
@ -202,11 +202,13 @@ pub trait DynTemplate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Template> DynTemplate for T {
|
impl<T: Template> DynTemplate for T {
|
||||||
|
#[inline]
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
fn dyn_render(&self) -> Result<String> {
|
fn dyn_render(&self) -> Result<String> {
|
||||||
<Self as Template>::render(self)
|
<Self as Template>::render(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn dyn_render_into(&self, writer: &mut dyn fmt::Write) -> Result<()> {
|
fn dyn_render_into(&self, writer: &mut dyn fmt::Write) -> Result<()> {
|
||||||
<Self as Template>::render_into(self, writer)
|
<Self as Template>::render_into(self, writer)
|
||||||
}
|
}
|
||||||
@ -217,12 +219,14 @@ impl<T: Template> DynTemplate for T {
|
|||||||
<Self as Template>::write_into(self, writer)
|
<Self as Template>::write_into(self, writer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn size_hint(&self) -> usize {
|
fn size_hint(&self) -> usize {
|
||||||
Self::SIZE_HINT
|
<Self as Template>::SIZE_HINT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for dyn DynTemplate {
|
impl fmt::Display for dyn DynTemplate {
|
||||||
|
#[inline]
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
self.dyn_render_into(f).map_err(|_| fmt::Error {})
|
self.dyn_render_into(f).map_err(|_| fmt::Error {})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user