Skip to content

Commit

Permalink
fix: Remove unnecessary imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Azumi4han committed Jul 27, 2024
1 parent 60e040f commit e47eff4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion examples/reply/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ publish = false
safe-vk = { path = "../../safe-vk", features = ["macros"] }
serde_json = "1.0.117"
serde = "1.0.203"
rand = { version = "0.8.5", features = ["small_rng"] }
tokio = { version = "1", features = ["full"] }
13 changes: 4 additions & 9 deletions safe-vk/src/start_polling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ pub struct Polling<M, S> {

pub fn start_polling<M, S>(token: &str, safevk: M) -> Polling<M, S>
where
M: Service<(), Response = S>,
S: Service<Update, Response = ()> + Clone + Send + 'static,
S::Future: Send,
M: Service<Update, Response = ()> + Send + Clone + 'static,
<M as Service<Update>>::Future: Send,
{
let request = RequestBuilder::new(token);
Polling {
Expand All @@ -29,10 +28,8 @@ where

impl<M, S> IntoFuture for Polling<M, S>
where
M: Service<(), Response = S> + Send + Clone + 'static + Service<Update>,
M: Service<Update, Response = S> + Send + Clone + 'static,
<M as Service<Update>>::Future: Send,
S: Service<Update, Response = ()> + Clone + Send + 'static,
S::Future: Send,
{
type Output = Response<()>;
type IntoFuture = PollFuture;
Expand All @@ -53,9 +50,7 @@ where
Ok(res) => {
if let Some(updates) = res.updates {
for event in updates {
poll_fn(|cx| <M as Service<Update>>::poll_ready(&mut safevk, cx))
.await
.unwrap();
poll_fn(|cx| safevk.poll_ready(cx)).await.unwrap();

let request_clone = Arc::clone(&request);
let mut safevk = safevk.clone();
Expand Down

0 comments on commit e47eff4

Please sign in to comment.