Skip to content

Commit

Permalink
style: use variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AH-dark committed Apr 7, 2024
1 parent 4ae87bb commit 20f5897
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rust-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ teloxide = { workspace = true }
redis = { workspace = true }
lapin = { workspace = true }
log = { workspace = true }
futures = { version = "0.3", features = [] }
futures = { version = "0.3", features = ["default"] }
serde_json = { version = "1.0.114", features = [] }
async-stream = "0.3.5"
reqwest = "0.12"
7 changes: 4 additions & 3 deletions rust-common/src/bot/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ impl<'a> AsUpdateStream<'a> for MqUpdateListener {

fn as_stream(&'a mut self) -> Self::Stream {
let flag = self.flag.clone();
Box::pin(self.consumer.clone().filter_map(move |delivery| {
let consumer = self.consumer.clone();

Box::pin(consumer.filter_map(move |delivery| {
assert!(!flag.is_stopped(), "Update listener stopped");
if self.consumer.state() != lapin::ConsumerState::Active
&& self.consumer.state() != lapin::ConsumerState::ActiveWithDelegate
Expand Down Expand Up @@ -56,8 +58,7 @@ impl<'a> AsUpdateStream<'a> for MqUpdateListener {
None
}
}
}
.boxed()
}.boxed()
}))
}
}
Expand Down

0 comments on commit 20f5897

Please sign in to comment.