Просмотр исходного кода

[Telegram] Minor comment fixes

Slava Barinov 2 лет назад
Родитель
Сommit
4778ad8d78
1 измененных файлов с 1 добавлено и 9 удалено
  1. 1 9
      src/telegram.rs

+ 1 - 9
src/telegram.rs

@@ -21,12 +21,6 @@ use thiserror::Error;
 use tokio::fs::File;
 use tokio::fs::File;
 use tokio::sync::mpsc;
 use tokio::sync::mpsc;
 
 
-// impl Into<i64> for ChatId {
-//     fn into(self) -> i64 {
-//         self.0
-//     }
-// }
-
 #[cfg(feature = "telegram")]
 #[cfg(feature = "telegram")]
 #[tokio::main]
 #[tokio::main]
 pub async fn bot() {
 pub async fn bot() {
@@ -117,7 +111,6 @@ async fn command_handler(
     Ok(())
     Ok(())
 }
 }
 
 
-#[cfg(feature = "telegram")]
 async fn download_file(downloader: &Bot, file_id: &str) -> Result<String, FileReceiveError> {
 async fn download_file(downloader: &Bot, file_id: &str) -> Result<String, FileReceiveError> {
     let TgFile { path, .. } = downloader.get_file(file_id).send().await?;
     let TgFile { path, .. } = downloader.get_file(file_id).send().await?;
     log::info!("Attempt to download file");
     log::info!("Attempt to download file");
@@ -504,7 +497,7 @@ async fn callback_handler(q: CallbackQuery, bot: Bot, dialogue: QIFDialogue) ->
 #[cfg(feature = "telegram")]
 #[cfg(feature = "telegram")]
 async fn run() {
 async fn run() {
     #[cfg(feature = "monitoring")]
     #[cfg(feature = "monitoring")]
-    let monitoring_handle = tokio::spawn(async { monitoring::web_main().await });
+    let monitoring_handle = tokio::spawn(async move { monitoring::web_main().await });
 
 
     log::info!("Starting telegram bot");
     log::info!("Starting telegram bot");
     let (_tx, mut rx) = mpsc::channel(32);
     let (_tx, mut rx) = mpsc::channel(32);
@@ -525,7 +518,6 @@ async fn run() {
                         .endpoint(command_handler),
                         .endpoint(command_handler),
                 )
                 )
                 .branch(dptree::case![State::Idle].endpoint(handle_idle))
                 .branch(dptree::case![State::Idle].endpoint(handle_idle))
-                // No idea about `{filename, }`, but otherwise thread "'tokio-runtime-worker' panicked at '(alloc::string::String,) was requested, but not provided."
                 .branch(dptree::case![State::NewJson { filename }].endpoint(handle_json))
                 .branch(dptree::case![State::NewJson { filename }].endpoint(handle_json))
                 .branch(
                 .branch(
                     dptree::case![State::CategorySelect {
                     dptree::case![State::CategorySelect {