mirror of
https://github.com/romanz/electrs.git
synced 2025-02-24 06:57:53 +01:00
Replace "Vec::new()" by shorter "vec![]"
This commit is contained in:
parent
1a9b977dad
commit
daee3fbe4b
1 changed files with 3 additions and 3 deletions
|
@ -270,7 +270,7 @@ impl Daemon {
|
|||
.iter()
|
||||
.map(|params| json!({"method": method, "params": params}))
|
||||
.collect();
|
||||
let mut results = Vec::new();
|
||||
let mut results = vec![];
|
||||
let mut replies = self.call_jsonrpc(method, &reqs)
|
||||
.chain_err(|| format!("RPC failed: {}", reqs))?;
|
||||
for reply in replies.as_array_mut().chain_err(|| "non-array response")? {
|
||||
|
@ -303,7 +303,7 @@ impl Daemon {
|
|||
.into_iter()
|
||||
.map(|hash| json!([hash, /*verbose=*/ false]))
|
||||
.collect();
|
||||
let mut result = Vec::new();
|
||||
let mut result = vec![];
|
||||
for h in self.requests("getblockheader", ¶ms_list)? {
|
||||
result.push(header_from_value(h)?);
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ impl Daemon {
|
|||
.map(|hash| json!([hash.be_hex_string(), /*verbose=*/ false]))
|
||||
.collect();
|
||||
let values = self.requests("getblock", ¶ms_list)?;
|
||||
let mut blocks = Vec::new();
|
||||
let mut blocks = vec![];
|
||||
for value in values {
|
||||
blocks.push(block_from_value(value)?);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue