diff --git a/Cargo.lock b/Cargo.lock index faf4d6cd80..d308b20e45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1059,6 +1059,7 @@ dependencies = [ "once_cell", "pest", "pest_derive", + "pollster", "pretty_assertions", "prost", "rand", @@ -1479,6 +1480,12 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "pollster" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" + [[package]] name = "ppv-lite86" version = "0.2.17" diff --git a/Cargo.toml b/Cargo.toml index ba924edd5c..87514944ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,6 +53,7 @@ num_cpus = "1.16.0" once_cell = "1.18.0" pest = "2.7.5" pest_derive = "2.7.5" +pollster = "0.3.0" pretty_assertions = "1.4.0" prost = "0.11.9" prost-build = "0.11.9" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 95d74bb23e..0e6c043a4e 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -19,7 +19,7 @@ harness = false version_check = { workspace = true } [dependencies] -async-trait = { workspace = true} +async-trait = { workspace = true } backoff = { workspace = true } blake2 = { workspace = true } byteorder = { workspace = true } @@ -37,6 +37,7 @@ maplit = { workspace = true } once_cell = { workspace = true } pest = { workspace = true } pest_derive = { workspace = true } +pollster = { workspace = true } prost = { workspace = true } rand = { workspace = true } rand_chacha = { workspace = true } diff --git a/lib/src/store.rs b/lib/src/store.rs index 705a799408..4b5de483a8 100644 --- a/lib/src/store.rs +++ b/lib/src/store.rs @@ -21,6 +21,7 @@ use std::io::Read; use std::sync::{Arc, RwLock}; use futures::executor::block_on; +use pollster::FutureExt as _; use crate::backend; use crate::backend::{ @@ -229,7 +230,7 @@ impl Store { path: &RepoPath, id: &ConflictId, ) -> BackendResult { - let backend_conflict = block_on(self.backend.read_conflict(path, id))?; + let backend_conflict = self.backend.read_conflict(path, id).block_on()?; Ok(Merge::from_backend_conflict(backend_conflict)) }