Skip to content

feat: TON LiteServer ANDL TCP Client #690

feat: TON LiteServer ANDL TCP Client

feat: TON LiteServer ANDL TCP Client #690

Triggered via pull request April 18, 2024 16:03
Status Success
Total duration 6m 18s
Artifacts

pr-check.yml

on: pull_request
Run rust-clippy analyzing
6m 4s
Run rust-clippy analyzing
Fit to window
Zoom out
Zoom in

Annotations

20 warnings
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`: ton-grpc/src/message.rs#L15
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> ton-grpc/src/message.rs:15:107 | 15 | async fn send_message(&self, request: Request<SendRequest>) -> Result<Response<SendResponse>, Status> { | ___________________________________________________________________________________________________________^ 16 | | let msg = request.into_inner(); 17 | | 18 | | let hash = self.client.send_message_returning_hash(&msg.body).await ... | 21 | | Ok(Response::new(SendResponse { hash })) 22 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`: ton-grpc/src/block.rs#L79
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> ton-grpc/src/block.rs:79:131 | 79 | async fn get_account_addresses(&self, request: Request<BlockId>) -> Result<Response<Self::GetAccountAddressesStream>, Status> { | ___________________________________________________________________________________________________________________________________^ 80 | | let msg = request.into_inner(); 81 | | let block_id = extend_block_id(&self.client, &msg).await 82 | | .map_err(|e: anyhow::Error| Status::internal(e.to_string()))?; ... | 89 | | Ok(Response::new(stream)) 90 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`: ton-grpc/src/block.rs#L51
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> ton-grpc/src/block.rs:51:144 | 51 | async fn get_transaction_ids(&self, request: Request<GetTransactionIdsRequest>) -> Result<Response<Self::GetTransactionIdsStream>, Status> { | ________________________________________________________________________________________________________________________________________________^ 52 | | let msg = request.into_inner(); 53 | | 54 | | let order = msg.order(); ... | 73 | | Ok(Response::new(stream)) 74 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`: ton-grpc/src/block.rs#L36
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> ton-grpc/src/block.rs:36:106 | 36 | async fn get_shards(&self, request: Request<BlockId>) -> Result<Response<GetShardsResponse>, Status> { | __________________________________________________________________________________________________________^ 37 | | let block_id = extend_block_id(&self.client, &request.into_inner()).await 38 | | .map_err(|e: anyhow::Error| Status::internal(e.to_string()))?; 39 | | ... | 45 | | })) 46 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`: ton-grpc/src/block.rs#L28
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> ton-grpc/src/block.rs:28:98 | 28 | async fn get_block(&self, request: Request<BlockId>) -> Result<Response<BlockIdExt>, Status> { | __________________________________________________________________________________________________^ 29 | | let block_id = extend_block_id(&self.client, &request.into_inner()).await 30 | | .map_err(|e: anyhow::Error| Status::internal(e.to_string()))?; 31 | | 32 | | Ok(Response::new(block_id.into())) 33 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`: ton-grpc/src/block.rs#L20
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> ton-grpc/src/block.rs:20:116 | 20 | async fn get_last_block(&self, _request: Request<GetLastBlockRequest>) -> Result<Response<BlockIdExt>, Status> { | ____________________________________________________________________________________________________________________^ 21 | | let block = self.client.get_masterchain_info().await 22 | | .map_err(|e: anyhow::Error| Status::internal(e.to_string()))?.last; 23 | | 24 | | Ok(Response::new(block.into())) 25 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`: ton-grpc/src/account.rs#L73
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> ton-grpc/src/account.rs:73:172 | 73 | async fn get_account_transactions(&self, request: Request<GetAccountTransactionsRequest>) -> std::result::Result<Response<Self::GetAccountTransactionsStream>, Status> { | ____________________________________________________________________________________________________________________________________________________________________________^ 74 | | let msg = request.into_inner(); 75 | | let client = self.client.clone(); 76 | | ... | 104 | | Ok(Response::new(stream)) 105 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`: ton-grpc/src/account.rs#L51
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> ton-grpc/src/account.rs:51:147 | 51 | async fn get_shard_account_cell(&self, request: Request<GetShardAccountCellRequest>) -> Result<Response<GetShardAccountCellResponse>, Status> { | ___________________________________________________________________________________________________________________________________________________^ 52 | | let msg = request.into_inner(); 53 | | 54 | | let (block_id, cell) = self.fetch_shard_account_cell(&msg) ... | 67 | | Ok(Response::new(response)) 68 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`: ton-grpc/src/account.rs#L25
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> ton-grpc/src/account.rs:25:147 | 25 | async fn get_account_state(&self, request: Request<GetAccountStateRequest>) -> std::result::Result<Response<GetAccountStateResponse>, Status> { | ___________________________________________________________________________________________________________________________________________________^ 26 | | let msg = request.into_inner(); 27 | | 28 | | let address = AccountAddressData::from_str(&msg.account_address) ... | 47 | | })) 48 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions = note: `#[warn(clippy::blocks_in_conditions)]` on by default
unneeded `return` statement: tonlibjson-client/src/router.rs#L152
warning: unneeded `return` statement --> tonlibjson-client/src/router.rs:152:17 | 152 | return Err(RouterError::RouteUnknown); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 152 - return Err(RouterError::RouteUnknown); 152 + Err(RouterError::RouteUnknown) |
using `clone` on type `Route` which implements the `Copy` trait: tonlibjson-client/src/router.rs#L97
warning: using `clone` on type `Route` which implements the `Copy` trait --> tonlibjson-client/src/router.rs:97:31 | 97 | let req = req.clone(); | ^^^^^^^^^^^ help: try removing the `clone` call: `req` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
this `let...else` may be rewritten with the `?` operator: tonlibjson-client/src/cursor_client.rs#L78
warning: this `let...else` may be rewritten with the `?` operator --> tonlibjson-client/src/cursor_client.rs:78:9 | 78 | / let Some(seqno) = self.right_end else { 79 | | return None; 80 | | }; | |__________^ help: replace it with: `let seqno = self.right_end?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark = note: `#[warn(clippy::question_mark)]` on by default
wildcard pattern covers any other pattern as it will match anyway: tonlibjson-client/src/block.rs#L134
warning: wildcard pattern covers any other pattern as it will match anyway --> tonlibjson-client/src/block.rs:134:13 | 134 | 1 | _ => BlockCriteria::Seqno { shard: self.id.shard, seqno: self.id.seqno } | ^^^^^ | = help: consider handling `_` separately = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns = note: `#[warn(clippy::wildcard_in_or_patterns)]` on by default
redundant closure: ton-liteserver-client/src/client.rs#L187
warning: redundant closure --> ton-liteserver-client/src/client.rs:187:34 | 187 | .map_err(|e| Error::LiteServerError(e))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Error::LiteServerError` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure = note: `#[warn(clippy::redundant_closure)]` on by default
use of `default` to create a unit struct: ton-liteserver-client/src/client.rs#L159
warning: use of `default` to create a unit struct --> ton-liteserver-client/src/client.rs:159:90 | 159 | Self { state: ResponseState::Failed { error: Some(error) }, _phantom: PhantomData::default() } | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
use of `default` to create a unit struct: ton-liteserver-client/src/client.rs#L155
warning: use of `default` to create a unit struct --> ton-liteserver-client/src/client.rs:155:91 | 155 | Self { state: ResponseState::Rx { query_id, responses, rx }, _phantom: PhantomData::default() } | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default
redundant pattern matching, consider using `is_err()`: ton-liteserver-client/src/client.rs#L130
warning: redundant pattern matching, consider using `is_err()` --> ton-liteserver-client/src/client.rs:130:16 | 130 | if let Err(_) = self.tx.send(request) { | -------^^^^^^------------------------ help: try: `if self.tx.send(request).is_err()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching = note: `#[warn(clippy::redundant_pattern_matching)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: tonlibjson-client/build.rs#L220
warning: this expression creates a reference which is immediately dereferenced by the compiler --> tonlibjson-client/build.rs:220:35 | 220 | if skip_list.contains(&&type_ident) { | ^^^^^^^^^^^^ help: change this to: `(&type_ident)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
Run rust-clippy analyzing
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Run rust-clippy analyzing
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/