From 517d34b436639b9a875fc5d34612bbb505637efd Mon Sep 17 00:00:00 2001 From: NotTheDr01ds <32344964+NotTheDr01ds@users.noreply.github.com> Date: Wed, 12 Mar 2025 18:23:32 -0400 Subject: [PATCH] Fixes from review --- crates/nu-command/src/filters/default.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/nu-command/src/filters/default.rs b/crates/nu-command/src/filters/default.rs index 4b8e682b65..067e4eb4de 100644 --- a/crates/nu-command/src/filters/default.rs +++ b/crates/nu-command/src/filters/default.rs @@ -25,7 +25,7 @@ impl Command for Default { ) .switch( "empty", - "also compact empty items like \"\", {}, and []", + "also remove empty items like \"\", {}, and []", Some('e'), ) .category(Category::Filters) @@ -143,9 +143,7 @@ fn default( .map(|x| x.set_metadata(metadata)) } else if input.is_nothing() || (default_when_empty - && (matches!(input, PipelineData::Value(Value::String { ref val, .. }, _) if val.is_empty()) - || matches!(input, PipelineData::Value(Value::Record { ref val, .. }, _) if val.is_empty()) - || matches!(input, PipelineData::Value(Value::List { ref vals, .. }, _) if vals.is_empty()))) + && matches!(input, PipelineData::Value(ref value, _) if value.is_empty())) { Ok(value.into_pipeline_data()) } else {