From 0821f6e3dae30e2056ce007658d90f0791b4f29e Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 10 Aug 2021 08:43:33 -0400 Subject: [PATCH] Default to streaming, not collection --- .../rust/preserves-tools/src/bin/preserves-tool.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/implementations/rust/preserves-tools/src/bin/preserves-tool.rs b/implementations/rust/preserves-tools/src/bin/preserves-tool.rs index 687ed8c..d89b09d 100644 --- a/implementations/rust/preserves-tools/src/bin/preserves-tool.rs +++ b/implementations/rust/preserves-tools/src/bin/preserves-tool.rs @@ -104,7 +104,7 @@ struct Convert { select_output: SelectOutput, #[clap(long)] - stream: bool, + collect: bool, #[clap(long, arg_enum, value_name = "on/off", default_value = "on")] annotations: Boolish, @@ -374,16 +374,16 @@ fn convert(c: Convert) -> io::Result<()> { while let Some(value) = vs.next() { let value = value?; let matches = c.select.exec(&value); - if c.stream { - match c.select_output { - SelectOutput::Sequence => for v in matches { w(&v)?; }, - SelectOutput::Set => for v in Set::from_iter(matches) { w(&v)?; }, - } - } else { + if c.collect { match c.select_output { SelectOutput::Sequence => w(&IOValue::new(matches))?, SelectOutput::Set => w(&IOValue::new(Set::from_iter(matches)))?, } + } else { + match c.select_output { + SelectOutput::Sequence => for v in matches { w(&v)?; }, + SelectOutput::Set => for v in Set::from_iter(matches) { w(&v)?; }, + } } if let Some(limit) = c.limit { if vs.count >= limit {