From dc0ac8e91725bda11ada3daed6a97799e64d2fc5 Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Thu, 19 Dec 2024 19:42:18 +0100 Subject: [PATCH] Remove `pub` on some command internals (#14636) Stumbled over unnecessary `pub` `fn action` and `struct Arguments` when reworking `into bits` in #14634 Stuff like this should be local until proven otherwise and then named approrpiately. --- crates/nu-command/src/conversions/into/binary.rs | 4 ++-- crates/nu-command/src/conversions/into/filesize.rs | 2 +- crates/nu-command/src/platform/ansi/strip.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/nu-command/src/conversions/into/binary.rs b/crates/nu-command/src/conversions/into/binary.rs index fb549e50a7..3993f65d19 100644 --- a/crates/nu-command/src/conversions/into/binary.rs +++ b/crates/nu-command/src/conversions/into/binary.rs @@ -1,7 +1,7 @@ use nu_cmd_base::input_handler::{operate, CmdArgument}; use nu_engine::command_prelude::*; -pub struct Arguments { +struct Arguments { cell_paths: Option>, compact: bool, } @@ -142,7 +142,7 @@ fn into_binary( } } -pub fn action(input: &Value, _args: &Arguments, span: Span) -> Value { +fn action(input: &Value, _args: &Arguments, span: Span) -> Value { let value = match input { Value::Binary { .. } => input.clone(), Value::Int { val, .. } => Value::binary(val.to_ne_bytes().to_vec(), span), diff --git a/crates/nu-command/src/conversions/into/filesize.rs b/crates/nu-command/src/conversions/into/filesize.rs index cfbdfc6f37..98b63597e7 100644 --- a/crates/nu-command/src/conversions/into/filesize.rs +++ b/crates/nu-command/src/conversions/into/filesize.rs @@ -116,7 +116,7 @@ impl Command for SubCommand { } } -pub fn action(input: &Value, _args: &CellPathOnlyArgs, span: Span) -> Value { +fn action(input: &Value, _args: &CellPathOnlyArgs, span: Span) -> Value { let value_span = input.span(); match input { Value::Filesize { .. } => input.clone(), diff --git a/crates/nu-command/src/platform/ansi/strip.rs b/crates/nu-command/src/platform/ansi/strip.rs index 5f172c5cdc..23063cff63 100644 --- a/crates/nu-command/src/platform/ansi/strip.rs +++ b/crates/nu-command/src/platform/ansi/strip.rs @@ -4,7 +4,7 @@ use nu_cmd_base::input_handler::{operate, CmdArgument}; use nu_engine::command_prelude::*; use nu_protocol::Config; -pub struct Arguments { +struct Arguments { cell_paths: Option>, config: Arc, }