From f83ff5970936482c6533f1135f4d6b4a423abb53 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Tue, 5 Apr 2022 16:42:52 +0400 Subject: [PATCH] Fix issues caused by the rebase --- Cargo.toml | 1 + src/dispatching/update_listeners/webhooks/axum.rs | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 86d017d6..69310e96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,6 +67,7 @@ dptree = { version = "0.1.0" } tokio = { version = "1.8", features = ["fs"] } tokio-util = "0.6" +tokio-stream = "0.1.8" url = "2.2.2" log = "0.4" diff --git a/src/dispatching/update_listeners/webhooks/axum.rs b/src/dispatching/update_listeners/webhooks/axum.rs index 37ec8d3d..e145c4b2 100644 --- a/src/dispatching/update_listeners/webhooks/axum.rs +++ b/src/dispatching/update_listeners/webhooks/axum.rs @@ -154,10 +154,7 @@ pub fn axum_no_setup( dispatching::{stop_token::AsyncStopToken, update_listeners}, types::Update, }; - use axum::{ - extract::Extension, http::StatusCode, response::IntoResponse, routing::post, - AddExtensionLayer, - }; + use axum::{extract::Extension, http::StatusCode, response::IntoResponse, routing::post}; use tokio::sync::mpsc; use tokio_stream::wrappers::UnboundedReceiverStream; use tower::ServiceBuilder; @@ -207,8 +204,8 @@ pub fn axum_no_setup( let app = axum::Router::new().route(options.url.path(), post(telegram_request)).layer( ServiceBuilder::new() .layer(TraceLayer::new_for_http()) - .layer(AddExtensionLayer::new(ClosableSender::new(tx))) - .layer(AddExtensionLayer::new(stop_flag.clone())) + .layer(Extension(ClosableSender::new(tx))) + .layer(Extension(stop_flag.clone())) .into_inner(), );