diff options
author | trinity-1686a <trinity@deuxfleurs.fr> | 2023-06-24 10:17:20 +0200 |
---|---|---|
committer | trinity-1686a <trinity@deuxfleurs.fr> | 2023-06-24 10:17:20 +0200 |
commit | 33b3cf8e227048525918b7f232fc250e44dc2d47 (patch) | |
tree | 1f05b6c1842afe6e0f78f1e4ea722315c1ba2afc /src/k2v-client/bin/k2v-cli.rs | |
parent | 736083063fb4f78e9d00d9f3279f902bd3a6aa0a (diff) | |
download | garage-33b3cf8e227048525918b7f232fc250e44dc2d47.tar.gz garage-33b3cf8e227048525918b7f232fc250e44dc2d47.zip |
introduce dedicated return type for PollRange
Diffstat (limited to 'src/k2v-client/bin/k2v-cli.rs')
-rw-r--r-- | src/k2v-client/bin/k2v-cli.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/k2v-client/bin/k2v-cli.rs b/src/k2v-client/bin/k2v-cli.rs index 5a2422ab..b9461c89 100644 --- a/src/k2v-client/bin/k2v-cli.rs +++ b/src/k2v-client/bin/k2v-cli.rs @@ -311,23 +311,19 @@ impl BatchOutputKind { .collect::<Vec<_>>() } - fn display_poll_range_output( - &self, - seen_marker: String, - values: BTreeMap<String, CausalValue>, - ) -> ! { + fn display_poll_range_output(&self, poll_range: PollRangeResult) -> ! { if self.json { let json = serde_json::json!({ - "values": self.values_json(values), - "seen_marker": seen_marker, + "values": self.values_json(poll_range.items), + "seen_marker": poll_range.seen_marker, }); let stdout = std::io::stdout(); serde_json::to_writer_pretty(stdout, &json).unwrap(); exit(0) } else { - println!("seen marker: {}", seen_marker); - self.display_human_output(values) + println!("seen marker: {}", poll_range.seen_marker); + self.display_human_output(poll_range.items) } } @@ -501,8 +497,8 @@ async fn main() -> Result<(), Error> { ) .await?; match res { - Some((items, seen_marker)) => { - output_kind.display_poll_range_output(seen_marker, items); + Some(poll_range_output) => { + output_kind.display_poll_range_output(poll_range_output); } None => { if output_kind.json { |