From bc2d65cd2ecffccf550ead70f2430fd7bda5a954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20N=2E=20Robalino?= Date: Sat, 23 Nov 2019 19:07:12 -0500 Subject: [PATCH] Remove raw data debugging. --- src/commands/debug.rs | 19 ++++++------------- tests/commands_test.rs | 2 +- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/commands/debug.rs b/src/commands/debug.rs index eaa493588d..f9639b7263 100644 --- a/src/commands/debug.rs +++ b/src/commands/debug.rs @@ -4,9 +4,7 @@ use crate::prelude::*; pub struct Debug; #[derive(Deserialize)] -pub struct DebugArgs { - raw: Tagged, -} +pub struct DebugArgs {} impl WholeStreamCommand for Debug { fn name(&self) -> &str { @@ -14,7 +12,7 @@ impl WholeStreamCommand for Debug { } fn signature(&self) -> Signature { - Signature::build("debug").switch("raw", "print raw data") + Signature::build("debug") } fn usage(&self) -> &str { @@ -31,19 +29,14 @@ impl WholeStreamCommand for Debug { } fn debug_value( - DebugArgs { raw }: DebugArgs, + _args: DebugArgs, RunnableContext { mut input, .. }: RunnableContext, -) -> Result { +) -> Result { let stream = async_stream! { while let Some(row) = input.values.next().await { - if let Tagged { item: true, .. } = raw { - println!("{:?}", row); - yield ReturnSuccess::value(row) - } else { - yield ReturnSuccess::debug_value(row.clone()) - } + yield ReturnSuccess::debug_value(row.clone()) } }; - Ok(stream.to_output_stream()) + Ok(stream) } diff --git a/tests/commands_test.rs b/tests/commands_test.rs index 2569bd02e9..646cf57cb8 100644 --- a/tests/commands_test.rs +++ b/tests/commands_test.rs @@ -36,7 +36,7 @@ fn compact_rows_where_given_column_is_empty() { } #[test] fn compact_empty_rows_by_default() { - Playground::setup("compact_test_2", |dirs, sandbox| { + Playground::setup("compact_test_2", |dirs, _| { let actual = nu!( cwd: dirs.test(), h::pipeline( r#"