diff --git a/crates/teloxide/src/utils/render/mod.rs b/crates/teloxide/src/utils/render/mod.rs index 2f42a89a..b8ffb8a1 100644 --- a/crates/teloxide/src/utils/render/mod.rs +++ b/crates/teloxide/src/utils/render/mod.rs @@ -142,12 +142,14 @@ impl<'a> Render<'a> { /// Render and return the text as **Html-formatted** string. #[must_use] + #[inline] pub fn as_html(&self) -> String { self.format(&html::HTML) } /// Render and return the text as **Markdown-formatted** string. #[must_use] + #[inline] pub fn as_markdown(&self) -> String { self.format(&markdown::MARKDOWN) } diff --git a/crates/teloxide/src/utils/render/tag.rs b/crates/teloxide/src/utils/render/tag.rs index 096b5d05..feff4d1c 100644 --- a/crates/teloxide/src/utils/render/tag.rs +++ b/crates/teloxide/src/utils/render/tag.rs @@ -9,10 +9,12 @@ pub struct Tag<'a> { } impl<'a> Tag<'a> { + #[inline(always)] pub const fn start(kind: Kind<'a>, offset: usize, index: usize) -> Self { Self { place: Place::Start, kind, offset, index } } + #[inline(always)] pub const fn end(kind: Kind<'a>, offset: usize, index: usize) -> Self { Self { place: Place::End, kind, offset, index } } @@ -74,6 +76,7 @@ pub struct SimpleTag { } impl SimpleTag { + #[inline] pub const fn new(start: &'static str, end: &'static str) -> Self { Self { start, end } } @@ -94,6 +97,7 @@ pub struct ComplexTag { } impl ComplexTag { + #[inline] pub const fn new(start: &'static str, middle: &'static str, end: &'static str) -> Self { Self { start, middle, end } }