diff --git a/crates/nu-command/src/commands/strings/str_/case/camel_case.rs b/crates/nu-command/src/commands/strings/str_/case/camel_case.rs index 8802e680..57f72f99 100644 --- a/crates/nu-command/src/commands/strings/str_/case/camel_case.rs +++ b/crates/nu-command/src/commands/strings/str_/case/camel_case.rs @@ -23,7 +23,7 @@ impl WholeStreamCommand for SubCommand { "converts a string to camelCase" } - fn run_with_actions(&self, args: CommandArgs) -> Result { + fn run(&self, args: CommandArgs) -> Result { operate(args, &to_camel_case) } diff --git a/crates/nu-command/src/commands/strings/str_/case/kebab_case.rs b/crates/nu-command/src/commands/strings/str_/case/kebab_case.rs index e427f61b..22c8d541 100644 --- a/crates/nu-command/src/commands/strings/str_/case/kebab_case.rs +++ b/crates/nu-command/src/commands/strings/str_/case/kebab_case.rs @@ -23,7 +23,7 @@ impl WholeStreamCommand for SubCommand { "converts a string to kebab-case" } - fn run_with_actions(&self, args: CommandArgs) -> Result { + fn run(&self, args: CommandArgs) -> Result { operate(args, &to_kebab_case) } diff --git a/crates/nu-command/src/commands/strings/str_/case/mod.rs b/crates/nu-command/src/commands/strings/str_/case/mod.rs index f65340fb..b9209c5e 100644 --- a/crates/nu-command/src/commands/strings/str_/case/mod.rs +++ b/crates/nu-command/src/commands/strings/str_/case/mod.rs @@ -7,7 +7,7 @@ pub mod snake_case; use crate::prelude::*; use nu_errors::ShellError; use nu_protocol::ShellTypeName; -use nu_protocol::{ColumnPath, Primitive, ReturnSuccess, UntaggedValue, Value}; +use nu_protocol::{ColumnPath, Primitive, UntaggedValue, Value}; use nu_source::Tag; use nu_value_ext::ValueExt; @@ -20,7 +20,7 @@ struct Arguments { column_paths: Vec, } -pub fn operate(args: CommandArgs, case_operation: &'static F) -> Result +pub fn operate(args: CommandArgs, case_operation: &'static F) -> Result where F: Fn(&str) -> String + Send + Sync + 'static, { @@ -34,7 +34,7 @@ where Ok(input .map(move |v| { if options.column_paths.is_empty() { - ReturnSuccess::value(action(&v, v.tag(), &case_operation)?) + action(&v, v.tag(), &case_operation) } else { let mut ret = v; @@ -45,10 +45,10 @@ where )?; } - ReturnSuccess::value(ret) + Ok(ret) } }) - .into_action_stream()) + .into_input_stream()) } pub fn action( diff --git a/crates/nu-command/src/commands/strings/str_/case/pascal_case.rs b/crates/nu-command/src/commands/strings/str_/case/pascal_case.rs index 99d4a19c..4d672e7d 100644 --- a/crates/nu-command/src/commands/strings/str_/case/pascal_case.rs +++ b/crates/nu-command/src/commands/strings/str_/case/pascal_case.rs @@ -23,7 +23,7 @@ impl WholeStreamCommand for SubCommand { "converts a string to PascalCase" } - fn run_with_actions(&self, args: CommandArgs) -> Result { + fn run(&self, args: CommandArgs) -> Result { operate(args, &to_pascal_case) } diff --git a/crates/nu-command/src/commands/strings/str_/case/screaming_snake_case.rs b/crates/nu-command/src/commands/strings/str_/case/screaming_snake_case.rs index 338e13f8..ee7a4a18 100644 --- a/crates/nu-command/src/commands/strings/str_/case/screaming_snake_case.rs +++ b/crates/nu-command/src/commands/strings/str_/case/screaming_snake_case.rs @@ -23,7 +23,7 @@ impl WholeStreamCommand for SubCommand { "converts a string to SCREAMING_SNAKE_CASE" } - fn run_with_actions(&self, args: CommandArgs) -> Result { + fn run(&self, args: CommandArgs) -> Result { operate(args, &to_screaming_snake_case) } diff --git a/crates/nu-command/src/commands/strings/str_/case/snake_case.rs b/crates/nu-command/src/commands/strings/str_/case/snake_case.rs index 7f40928f..9983daa0 100644 --- a/crates/nu-command/src/commands/strings/str_/case/snake_case.rs +++ b/crates/nu-command/src/commands/strings/str_/case/snake_case.rs @@ -23,7 +23,7 @@ impl WholeStreamCommand for SubCommand { "converts a string to snake_case" } - fn run_with_actions(&self, args: CommandArgs) -> Result { + fn run(&self, args: CommandArgs) -> Result { operate(args, &to_snake_case) }