aboutsummaryrefslogtreecommitdiff
path: root/src/garage/cli/layout.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-11-09 14:12:05 +0100
committerAlex Auvolat <alex@adnab.me>2023-11-09 14:12:05 +0100
commitbfb1845fdc981a370539d641a5d80f438f184f07 (patch)
tree180ec9bf0e6bdf4148c80304fd48c22d92cdcc10 /src/garage/cli/layout.rs
parent19ef1ec8e7fee3a6c670e6e35dfcc83f0801e604 (diff)
downloadgarage-bfb1845fdc981a370539d641a5d80f438f184f07.tar.gz
garage-bfb1845fdc981a370539d641a5d80f438f184f07.zip
layout: refactor to use a RwLock on LayoutHistory
Diffstat (limited to 'src/garage/cli/layout.rs')
-rw-r--r--src/garage/cli/layout.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/garage/cli/layout.rs b/src/garage/cli/layout.rs
index bffc81d3..269d92f4 100644
--- a/src/garage/cli/layout.rs
+++ b/src/garage/cli/layout.rs
@@ -1,5 +1,3 @@
-use std::sync::Arc;
-
use bytesize::ByteSize;
use format_table::format_table;
@@ -323,7 +321,7 @@ pub async fn fetch_layout(
.call(&rpc_host, SystemRpc::PullClusterLayout, PRIO_NORMAL)
.await??
{
- SystemRpc::AdvertiseClusterLayout(t) => Ok(Arc::try_unwrap(t).unwrap()),
+ SystemRpc::AdvertiseClusterLayout(t) => Ok(t),
resp => Err(Error::Message(format!("Invalid RPC response: {:?}", resp))),
}
}
@@ -336,7 +334,7 @@ pub async fn send_layout(
rpc_cli
.call(
&rpc_host,
- SystemRpc::AdvertiseClusterLayout(Arc::new(layout)),
+ SystemRpc::AdvertiseClusterLayout(layout),
PRIO_NORMAL,
)
.await??;