Skip to content

Commit a298b78

Browse files
committed
chore: fix clippy warning about Instant
1 parent 79e1657 commit a298b78

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

stackslib/src/main.rs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use std::fs::File;
3737
use std::io::prelude::*;
3838
use std::io::BufReader;
3939
use std::net::{SocketAddr, TcpStream, ToSocketAddrs};
40-
use std::time::Duration;
40+
use std::time::{Duration, Instant};
4141
use std::{env, fs, io, process, thread};
4242

4343
use blockstack_lib::burnchains::bitcoin::{spv, BitcoinNetworkType};
@@ -605,7 +605,7 @@ Given a <working-dir>, obtain a 2100 header hash block inventory (with an empty
605605
let chain_tip = SortitionDB::get_canonical_burn_chain_tip(sort_db.conn())
606606
.expect("Failed to get sortition chain tip");
607607

608-
let start = time::Instant::now();
608+
let start = Instant::now();
609609

610610
let header_hashes = {
611611
let ic = sort_db.index_conn();
@@ -614,14 +614,11 @@ Given a <working-dir>, obtain a 2100 header hash block inventory (with an empty
614614
.unwrap()
615615
};
616616

617-
println!(
618-
"Fetched header hashes in {}",
619-
start.elapsed().as_seconds_f32()
620-
);
621-
let start = time::Instant::now();
617+
println!("Fetched header hashes in {}", start.elapsed().as_secs_f32());
618+
let start = Instant::now();
622619

623620
let block_inv = chain_state.get_blocks_inventory(&header_hashes).unwrap();
624-
println!("Fetched block inv in {}", start.elapsed().as_seconds_f32());
621+
println!("Fetched block inv in {}", start.elapsed().as_secs_f32());
625622
println!("{:?}", &block_inv);
626623

627624
println!("Done!");
@@ -652,7 +649,7 @@ check if the associated microblocks can be downloaded
652649
let chain_tip = SortitionDB::get_canonical_burn_chain_tip(sort_db.conn())
653650
.expect("Failed to get sortition chain tip");
654651

655-
let start = time::Instant::now();
652+
let start = Instant::now();
656653
let local_peer = LocalPeer::new(
657654
0,
658655
0,
@@ -671,12 +668,9 @@ check if the associated microblocks can be downloaded
671668
.unwrap()
672669
};
673670

674-
println!(
675-
"Fetched header hashes in {}",
676-
start.elapsed().as_seconds_f32()
677-
);
671+
println!("Fetched header hashes in {}", start.elapsed().as_secs_f32());
678672

679-
let start = time::Instant::now();
673+
let start = Instant::now();
680674
let mut total_load_headers = 0;
681675

682676
for (consensus_hash, block_hash_opt) in header_hashes.iter() {
@@ -736,7 +730,7 @@ check if the associated microblocks can be downloaded
736730

737731
println!(
738732
"Checked can_download in {} (headers load took {}ms)",
739-
start.elapsed().as_seconds_f32(),
733+
start.elapsed().as_secs_f32(),
740734
total_load_headers
741735
);
742736

0 commit comments

Comments
 (0)