From 695ea93e067a7d47a7f753fc20aec98a214784e0 Mon Sep 17 00:00:00 2001 From: Mr-Andersen Date: Tue, 24 Sep 2019 19:32:57 +0300 Subject: [PATCH] bool -> Option --- src/requests/pin_chat_message.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/requests/pin_chat_message.rs b/src/requests/pin_chat_message.rs index 5b9ddfde..f50110b2 100644 --- a/src/requests/pin_chat_message.rs +++ b/src/requests/pin_chat_message.rs @@ -13,18 +13,20 @@ pub struct PinChatMessage<'a> { /// of the target supergroup or channel (in the format @channelusername) pub chat_id: ChatId, pub message_id: i32, - pub disable_notification: bool + pub disable_notification: Option } impl<'a> PinChatMessage<'a> { pub(crate) fn new( ctx: RequestContext<'a>, chat_id: ChatId, message_id: i32 ) -> Self { - Self { ctx, chat_id, message_id, disable_notification: false } + Self { ctx, chat_id, message_id, disable_notification: None } } - pub fn disable_notification(mut self) -> Self { - self.disable_notification = true; + pub fn disable_notification(mut self, val: T) -> Self + where T: Into + { + self.disable_notification = Some(val.into()); self } }