diff --git a/crates/nu-command/src/commands/strings/str_/capitalize.rs b/crates/nu-command/src/commands/strings/str_/capitalize.rs index f4d81ef863..b0f6ff53fc 100644 --- a/crates/nu-command/src/commands/strings/str_/capitalize.rs +++ b/crates/nu-command/src/commands/strings/str_/capitalize.rs @@ -2,9 +2,7 @@ use crate::prelude::*; use nu_engine::WholeStreamCommand; use nu_errors::ShellError; use nu_protocol::ShellTypeName; -use nu_protocol::{ - ColumnPath, Primitive, ReturnSuccess, Signature, SyntaxShape, UntaggedValue, Value, -}; +use nu_protocol::{ColumnPath, Primitive, Signature, SyntaxShape, UntaggedValue, Value}; use nu_source::Tag; use nu_value_ext::ValueExt; @@ -30,7 +28,7 @@ impl WholeStreamCommand for SubCommand { "capitalizes text" } - fn run_with_actions(&self, args: CommandArgs) -> Result { + fn run(&self, args: CommandArgs) -> Result { operate(args) } @@ -43,7 +41,7 @@ impl WholeStreamCommand for SubCommand { } } -fn operate(args: CommandArgs) -> Result { +fn operate(args: CommandArgs) -> Result { let (options, input) = ( Arguments { column_paths: args.rest(0)?, @@ -54,7 +52,7 @@ fn operate(args: CommandArgs) -> Result { Ok(input .map(move |v| { if options.column_paths.is_empty() { - ReturnSuccess::value(action(&v, v.tag())?) + action(&v, v.tag()) } else { let mut ret = v; @@ -65,10 +63,10 @@ fn operate(args: CommandArgs) -> Result { )?; } - ReturnSuccess::value(ret) + Ok(ret) } }) - .into_action_stream()) + .into_input_stream()) } fn action(input: &Value, tag: impl Into) -> Result {