forked from extern/nushell
Split OutputStream into ActionStream/OutputStream (#3304)
* Split OutputStream into ActionStream/OutputStream * Fmt * Missed update * Cleanup helper names * Fmt
This commit is contained in:
@ -28,7 +28,7 @@ impl WholeStreamCommand for Command {
|
||||
"Keep the number of rows only."
|
||||
}
|
||||
|
||||
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
fn run_with_actions(&self, args: CommandArgs) -> Result<ActionStream, ShellError> {
|
||||
keep(args)
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ impl WholeStreamCommand for Command {
|
||||
}
|
||||
}
|
||||
|
||||
fn keep(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
fn keep(args: CommandArgs) -> Result<ActionStream, ShellError> {
|
||||
let (Arguments { rows }, input) = args.process()?;
|
||||
let rows_desired = if let Some(quantity) = rows {
|
||||
*quantity
|
||||
@ -61,7 +61,7 @@ fn keep(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
1
|
||||
};
|
||||
|
||||
Ok(input.take(rows_desired).to_output_stream())
|
||||
Ok(input.take(rows_desired).to_action_stream())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -27,7 +27,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
"Keeps rows until the condition matches."
|
||||
}
|
||||
|
||||
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
fn run_with_actions(&self, args: CommandArgs) -> Result<ActionStream, ShellError> {
|
||||
let ctx = Arc::new(EvaluationContext::from_args(&args));
|
||||
|
||||
let call_info = args.evaluate_once()?;
|
||||
@ -93,7 +93,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
!matches!(result, Ok(ref v) if v.is_true())
|
||||
})
|
||||
.to_output_stream())
|
||||
.to_action_stream())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
"Keeps rows while the condition matches."
|
||||
}
|
||||
|
||||
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
fn run_with_actions(&self, args: CommandArgs) -> Result<ActionStream, ShellError> {
|
||||
let ctx = Arc::new(EvaluationContext::from_args(&args));
|
||||
let call_info = args.evaluate_once()?;
|
||||
|
||||
@ -92,7 +92,7 @@ impl WholeStreamCommand for SubCommand {
|
||||
|
||||
matches!(result, Ok(ref v) if v.is_true())
|
||||
})
|
||||
.to_output_stream())
|
||||
.to_action_stream())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user