Remove unnecessary derefs

This commit is contained in:
PatriotRossii 2020-08-07 06:08:22 +05:00 committed by GitHub
parent 817f492223
commit 517afc0cfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1007,10 +1007,10 @@ impl Bot {
where
T: Into<String>,
{
match self.parse_mode.deref() {
match self.parse_mode {
None => EditMessageText::new(self.clone(), chat_or_inline_message, text),
Some(parse_mode) => EditMessageText::new(self.clone(), chat_or_inline_message, text)
.parse_mode(*parse_mode.deref()),
.parse_mode(parse_mode),
}
}
@ -1033,10 +1033,10 @@ impl Bot {
&self,
chat_or_inline_message: ChatOrInlineMessage,
) -> EditMessageCaption {
match self.parse_mode.deref() {
match self.parse_mode {
None => EditMessageCaption::new(self.clone(), chat_or_inline_message),
Some(parse_mode) => EditMessageCaption::new(self.clone(), chat_or_inline_message)
.parse_mode(*parse_mode.deref()),
.parse_mode(parse_mode),
}
}
@ -1530,9 +1530,9 @@ impl Bot {
builder: Builder,
f: fn(Builder, ParseMode) -> Builder,
) -> Builder {
match self.parse_mode.deref() {
match self.parse_mode {
None => builder,
Some(parse_mode) => f(builder, *parse_mode.deref()),
Some(parse_mode) => f(builder, parse_mode),
}
}
}