Skip to content

Commit

Permalink
Update clippy in test & fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kostekIV committed May 10, 2024
1 parent f297306 commit 3281f89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2023-09-29
toolchain: nightly-2024-02-09
components: rustfmt, clippy
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Check format
run: cargo +nightly-2023-09-29 fmt --all -- --check
run: cargo +nightly-2024-02-09 fmt --all -- --check
- name: Check clippy
run: cargo +nightly-2023-09-29 clippy --all-targets --all-features -- -D warnings
run: cargo +nightly-2024-02-09 clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --verbose
- name: Run tests
Expand Down
14 changes: 8 additions & 6 deletions src/extensions/client/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl Endpoint {
params: Vec<serde_json::Value>,
timeout: Duration,
) -> Result<serde_json::Value, jsonrpsee::core::client::Error> {
match tokio::time::timeout(timeout, async {
let request_result = tokio::time::timeout(timeout, async {
self.connected().await;
let client = self
.client_rx
Expand All @@ -149,8 +149,9 @@ impl Endpoint {
}
}
})
.await
{
.await;

match request_result {
Ok(res) => res,
Err(_) => {
tracing::error!("request timed out method: {method} params: {params:?}");
Expand All @@ -167,7 +168,7 @@ impl Endpoint {
unsubscribe_method: &str,
timeout: Duration,
) -> Result<Subscription<serde_json::Value>, jsonrpsee::core::client::Error> {
match tokio::time::timeout(timeout, async {
let subscription_result = tokio::time::timeout(timeout, async {
self.connected().await;
let client = self
.client_rx
Expand All @@ -185,8 +186,9 @@ impl Endpoint {
}
}
})
.await
{
.await;

match subscription_result {
Ok(res) => res,
Err(_) => {
tracing::error!("subscribe timed out subscribe: {subscribe_method} params: {params:?}");
Expand Down

0 comments on commit 3281f89

Please sign in to comment.