diff --git a/src/commands/from_csv.rs b/src/commands/from_csv.rs index de2b0d059..9483fed52 100644 --- a/src/commands/from_csv.rs +++ b/src/commands/from_csv.rs @@ -18,7 +18,11 @@ impl WholeStreamCommand for FromCSV { fn signature(&self) -> Signature { Signature::build("from-csv") - .named("separator", SyntaxShape::String, "a character to separate columns, defaults to ','") + .named( + "separator", + SyntaxShape::String, + "a character to separate columns, defaults to ','", + ) .switch("headerless", "don't treat the first row as column names") } @@ -94,20 +98,22 @@ fn from_csv( ) -> Result { let name_tag = name; let sep = match separator { - Some(Tagged { item: Value::Primitive(Primitive::String(s)), tag, .. }) => { + Some(Tagged { + item: Value::Primitive(Primitive::String(s)), + tag, + .. + }) => { let vec_s: Vec = s.chars().collect(); if vec_s.len() != 1 { return Err(ShellError::labeled_error( "Expected a single separator char from --separator", "requires a single character string input", tag, - )) + )); }; vec_s[0] } - _ => { - ',' - } + _ => ',', }; let stream = async_stream! {