aboutsummaryrefslogtreecommitdiff
path: root/src/builder/edit_message.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-07-04 21:28:22 -0700
committerZeyla Hellyer <[email protected]>2018-07-04 21:32:17 -0700
commit7b9764cf1097b0620d871fabe67b5593f0cd4a4a (patch)
tree5b9f3eac6e9c57ac255c73bd1eea07669838f32d /src/builder/edit_message.rs
parentFix dead doc-links and add missing ones. (#347) (diff)
downloadserenity-7b9764cf1097b0620d871fabe67b5593f0cd4a4a.tar.xz
serenity-7b9764cf1097b0620d871fabe67b5593f0cd4a4a.zip
Monomorphize all functions
This commit monomorphizes all functions, turning functions like: ```rust fn foo<T: Into<Bar>>(baz: T) { baz = baz.into(); // function here } ``` Into functions like: ```rust fn foo<T: Into<Bar>>(baz: T) { _foo(baz.into()) } fn _foo(baz: Bar) { // function here } ``` This avoids binary bloat and improves build times, by reducing the amount of code duplication.
Diffstat (limited to 'src/builder/edit_message.rs')
-rw-r--r--src/builder/edit_message.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/builder/edit_message.rs b/src/builder/edit_message.rs
index 29da46a..c62f072 100644
--- a/src/builder/edit_message.rs
+++ b/src/builder/edit_message.rs
@@ -26,7 +26,12 @@ impl EditMessage {
/// Set the content of the message.
///
/// **Note**: Message contents must be under 2000 unicode code points.
- pub fn content<D: Display>(mut self, content: D) -> Self {
+ #[inline]
+ pub fn content<D: Display>(self, content: D) -> Self {
+ self._content(content.to_string())
+ }
+
+ fn _content(mut self, content: String) -> Self {
self.0.insert("content", Value::String(content.to_string()));
self