From 37aee5c1e98f7fa5d84f8a1f4bd31655e76ac2ae Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 17 May 2021 14:22:25 +0100 Subject: [PATCH] progress: Make ProgressMode come from MgmtChannel That's where the implementation (and any restrictions) come from. Signed-off-by: Ian Jackson --- src/bin/otter.rs | 2 +- src/mgmtchannel.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index 66be469a..1fd1b17c 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -1398,7 +1398,7 @@ mod upload_bundle { size, game: instance_name.clone(), hash: bundles::Hash(hash.into()), kind, - progress: PUM::Simplex, + progress: MgmtChannel::PROGRESS, }; let mut progress = termprogress::new(); chan.cmd_withbulk(&cmd, &mut f, &mut io::sink(), &mut *progress)?; diff --git a/src/mgmtchannel.rs b/src/mgmtchannel.rs index a40d961c..8d8ad02a 100644 --- a/src/mgmtchannel.rs +++ b/src/mgmtchannel.rs @@ -47,6 +47,8 @@ impl Debug for MgmtChannel{ } impl MgmtChannel { + pub const PROGRESS: ProgressUpdateMode = PUM::Simplex; + #[throws(AE)] pub fn connect(socket_path: &str) -> MgmtChannel { let unix = UnixStream::connect(socket_path) -- 2.30.2