aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-08-08 10:07:54 +0200
committeracdenisSK <[email protected]>2017-08-08 10:07:54 +0200
commitf16af97707edfc36f52fa836791d07512e5d41ef (patch)
tree7817b622afc22119b94061a88213c23e42e4daac /src
parentFix the test `message_content_safe` (diff)
downloadserenity-f16af97707edfc36f52fa836791d07512e5d41ef.tar.xz
serenity-f16af97707edfc36f52fa836791d07512e5d41ef.zip
Remove the `I` bound for the language param and fix `push_mono_safe`
Diffstat (limited to 'src')
-rw-r--r--src/utils/message_builder.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/message_builder.rs b/src/utils/message_builder.rs
index 4a7783b..d1fd2f5 100644
--- a/src/utils/message_builder.rs
+++ b/src/utils/message_builder.rs
@@ -234,11 +234,11 @@ impl MessageBuilder {
///
/// assert_eq!(content, "```\nhello\n```");
/// ```
- pub fn push_codeblock<D: I, L: I>(mut self, content: D, language: Option<L>) -> Self {
+ pub fn push_codeblock<D: I>(mut self, content: D, language: Option<&str>) -> Self {
self.0.push_str("```");
if let Some(language) = language {
- self.0.push_str(&language.into().to_string());
+ self.0.push_str(language);
}
self.0.push('\n');
@@ -475,11 +475,11 @@ impl MessageBuilder {
}
/// Pushes a code-block to your message normalizing content.
- pub fn push_codeblock_safe<D: I, L: I>(mut self, content: D, language: Option<L>) -> Self {
+ pub fn push_codeblock_safe<D: I>(mut self, content: D, language: Option<&str>) -> Self {
self.0.push_str("```");
if let Some(language) = language {
- self.0.push_str(&language.into().to_string());
+ self.0.push_str(language);
}
{
@@ -497,7 +497,7 @@ impl MessageBuilder {
self.0.push('`');
{
let mut c = content.into();
- c.inner = normalize(&c.inner).replace('`', " ");
+ c.inner = normalize(&c.inner).replace('`', "'");
self.0.push_str(&c.to_string());
}
self.0.push('`');