Skip to content

Commit 1f7db13

Browse files
author
Gabriel Comte
committed
Use borrowed array instead of vector as param
1 parent ccf6f32 commit 1f7db13

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

client/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ pub trait RpcApi: Sized {
443443
self.call("getblockstats", &[height.into()])
444444
}
445445

446-
fn get_block_stats_fields(&self, height: u64, fields: &Vec<json::BlockStatsFields>) -> Result<json::GetBlockStatsResultPartial> {
446+
fn get_block_stats_fields(&self, height: u64, fields: &[json::BlockStatsFields]) -> Result<json::GetBlockStatsResultPartial> {
447447
let fields: Vec<&str> = fields.iter()
448448
.map(|field| field.get_rpc_keyword())
449449
.collect();

integration_test/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ fn test_get_block_stats_fields(cl: &Client) {
324324
let tip = cl.get_block_count().unwrap();
325325
let tip_hash = cl.get_best_block_hash().unwrap();
326326
let header = cl.get_block_header(&tip_hash).unwrap();
327-
let fields = vec![BlockStatsFields::BlockHash, BlockStatsFields::Height, BlockStatsFields::TotalFee];
327+
let fields = [BlockStatsFields::BlockHash, BlockStatsFields::Height, BlockStatsFields::TotalFee];
328328
let stats = cl.get_block_stats_fields(tip, &fields).unwrap();
329329
assert_eq!(header.block_hash(), stats.block_hash.unwrap());
330330
assert_eq!(tip, stats.height.unwrap());

0 commit comments

Comments
 (0)