Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Jan 30, 2023
1 parent 1c765cb commit 88c6b77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
submodules: recursive
- name: Check format
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --verbose
- name: Run tests
Expand Down
4 changes: 2 additions & 2 deletions src/middleware/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ impl<Request: Send + 'static, Result: 'static> Middlewares<Request, Result> {
}

pub async fn call(&self, request: Request) -> Result {
let mut iter = self.middlewares.iter().rev();
let iter = self.middlewares.iter().rev();
let fallback = self.fallback.clone();
let mut next: Box<dyn FnOnce(Request) -> BoxFuture<'static, Result> + Send + Sync> =
Box::new(move |request| (fallback)(request));

while let Some(middleware) = iter.next() {
for middleware in iter {
let middleware = middleware.clone();
let next2 = next;
next = Box::new(move |request| {
Expand Down
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub async fn start_server(
})
})?;

let upstream = Arc::new(subscription::UpstreamMiddleware::new(client.clone()));
let upstream = Arc::new(subscription::UpstreamMiddleware::new(client));

for subscription in &config.rpcs.subscriptions {
let subscribe_name = string_to_static_str(subscription.subscribe.clone());
Expand Down

0 comments on commit 88c6b77

Please sign in to comment.