Skip to content

Commit c25e149

Browse files
committed
Make simple forwarding methods #[inline]
1 parent 9e78d13 commit c25e149

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

rinja/src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,33 +200,39 @@ pub trait DynTemplate {
200200
}
201201

202202
impl<T: Template> DynTemplate for T {
203+
#[inline]
203204
fn dyn_render(&self) -> Result<String> {
204-
<Self as Template>::render(self)
205+
Self::render(self)
205206
}
206207

208+
#[inline]
207209
fn dyn_render_into(&self, writer: &mut dyn fmt::Write) -> Result<()> {
208-
<Self as Template>::render_into(self, writer)
210+
Self::render_into(self, writer)
209211
}
210212

211213
#[inline]
212214
fn dyn_write_into(&self, writer: &mut dyn io::Write) -> io::Result<()> {
213-
<Self as Template>::write_into(self, writer)
215+
Self::write_into(self, writer)
214216
}
215217

218+
#[inline]
216219
fn extension(&self) -> Option<&'static str> {
217220
Self::EXTENSION
218221
}
219222

223+
#[inline]
220224
fn size_hint(&self) -> usize {
221225
Self::SIZE_HINT
222226
}
223227

228+
#[inline]
224229
fn mime_type(&self) -> &'static str {
225230
Self::MIME_TYPE
226231
}
227232
}
228233

229234
impl fmt::Display for dyn DynTemplate {
235+
#[inline]
230236
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
231237
self.dyn_render_into(f).map_err(|_| fmt::Error {})
232238
}

0 commit comments

Comments
 (0)