clippy: fix warnings

This commit is contained in:
Akulij 2025-04-28 17:47:31 +03:00
parent 03e42c9108
commit 2aff289a96
2 changed files with 4 additions and 7 deletions

View File

@ -78,7 +78,7 @@ pub async fn secret_command_handler(
println!("MSG: {}", msg.html_text().unwrap());
match cmd {
SecretCommands::Secret { pass } => {
if user.is_admin == true {
if user.is_admin {
bot.send_message(msg.from.unwrap().id, "You are an admin already")
.await?;
} else if pass == admin_password {

View File

@ -91,7 +91,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let state_mgr = MongodbStorage::open(config.db_url.clone().as_ref(), "gongbot", Json).await?;
// TODO: delete this in production
let events: Vec<DateTime<Utc>> = vec!["2025-04-09T18:00:00+04:00", "2025-04-11T16:00:00+04:00"]
let events: Vec<DateTime<Utc>> = ["2025-04-09T18:00:00+04:00", "2025-04-11T16:00:00+04:00"]
.iter()
.map(|d| DateTime::parse_from_rfc3339(d).unwrap().into())
.collect();
@ -160,10 +160,7 @@ async fn callback_handler(
"more_info" => {
answer_message(
&bot,
q.chat_id()
.clone()
.map(|i| i.0)
.unwrap_or(q.from.id.0 as i64),
q.chat_id().map(|i| i.0).unwrap_or(q.from.id.0 as i64),
&mut db,
"more_info",
None as Option<InlineKeyboardMarkup>,
@ -442,7 +439,7 @@ async fn answer_message<RM: Into<ReplyMarkup>>(
.await
.unwrap()
.unwrap_or("Please, set content of this message".into());
let media = db.get_media(&literal).await.unwrap();
let media = db.get_media(literal).await.unwrap();
let (chat_id, msg_id) = match media.len() {
// just a text
0 => {