Un Arc<_> Bot::parse_mode

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

View file

@ -20,7 +20,7 @@ pub(crate) const TELOXIDE_PROXY: &str = "TELOXIDE_PROXY";
pub struct Bot {
token: Arc<str>,
client: Client,
parse_mode: Arc<Option<ParseMode>>,
parse_mode: Option<ParseMode>,
}
impl Bot {
@ -95,7 +95,7 @@ impl Bot {
Self {
token: Into::<Arc<str>>::into(Into::<String>::into(token)),
client,
parse_mode: Arc::new(None),
parse_mode: None,
}
}
}
@ -236,7 +236,7 @@ impl BotBuilder {
Bot {
client: self.client.unwrap_or_else(crate::utils::client_from_env),
token: self.token.unwrap_or_else(|| get_env(TELOXIDE_TOKEN)).into(),
parse_mode: Arc::new(self.parse_mode),
parse_mode: self.parse_mode,
}
}
}