From e9c847bbd774f698f028ab0ce424619fb56cf37f Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Thu, 12 Nov 2020 20:01:16 -0800 Subject: [PATCH] zebrad: avoid a borrow in the ChainSync future --- zebrad/src/commands/start.rs | 2 +- zebrad/src/components/sync.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zebrad/src/commands/start.rs b/zebrad/src/commands/start.rs index 619d47bde..f829f3552 100644 --- a/zebrad/src/commands/start.rs +++ b/zebrad/src/commands/start.rs @@ -75,7 +75,7 @@ impl StartCmd { .map_err(|_| eyre!("could not send setup data to inbound service"))?; info!("initializing syncer"); - let mut syncer = ChainSync::new(&config, peer_set, state, verifier); + let syncer = ChainSync::new(&config, peer_set, state, verifier); syncer.sync().await } diff --git a/zebrad/src/components/sync.rs b/zebrad/src/components/sync.rs index ecf687b2b..ba749a4c9 100644 --- a/zebrad/src/components/sync.rs +++ b/zebrad/src/components/sync.rs @@ -169,7 +169,7 @@ where } #[instrument(skip(self))] - pub async fn sync(&mut self) -> Result<(), Report> { + pub async fn sync(mut self) -> Result<(), Report> { // We can't download the genesis block using our normal algorithm, // due to protocol limitations self.request_genesis().await?;