Skip to content

Commit

Permalink
Make MessageBuilder::push_spoiler_* consistent with the other `push…
Browse files Browse the repository at this point in the history
…_` functions (#642)
  • Loading branch information
anyputer authored and arqunis committed Jul 6, 2019
1 parent e6c5d41 commit d2df2b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utils/message_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl MessageBuilder {
}

/// Pushes a spoiler'd inline text to the content.
pub fn push_spoiler<D: I>(mut self, content: D) -> Self {
pub fn push_spoiler<D: I>(&mut self, content: D) -> &mut Self {
self.0.push_str("||");
self.0.push_str(&content.into().to_string());
self.0.push_str("||");
Expand Down Expand Up @@ -516,8 +516,8 @@ impl MessageBuilder {
///
/// assert_eq!(content, "||hello||\nworld");
/// ```
pub fn push_spoiler_line<D: I>(mut self, content: D) -> Self {
self = self.push_spoiler(content);
pub fn push_spoiler_line<D: I>(&mut self, content: D) -> &mut Self {
self.push_spoiler(content);
self.0.push('\n');

self
Expand Down Expand Up @@ -624,7 +624,7 @@ impl MessageBuilder {
}

/// Pushes a spoiler'd inline text to the content normalizing content.
pub fn push_spoiler_safe<D: I>(mut self, content: D) -> Self {
pub fn push_spoiler_safe<D: I>(&mut self, content: D) -> &mut Self {
self.0.push_str("||");
{
let mut c = content.into();
Expand Down Expand Up @@ -785,8 +785,8 @@ impl MessageBuilder {
///
/// assert_eq!(content, "||@\u{200B}everyone||\nIsn't a mention.");
/// ```
pub fn push_spoiler_line_safe<D: I>(mut self, content: D) -> Self {
self = self.push_spoiler_safe(content);
pub fn push_spoiler_line_safe<D: I>(&mut self, content: D) -> &mut Self {
self.push_spoiler_safe(content);
self.0.push('\n');

self
Expand Down

0 comments on commit d2df2b9

Please sign in to comment.