From 11b40a6c314b1d3f477cc8bbae94edb6e4fbe5f1 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Tue, 5 Oct 2021 10:30:49 -0500 Subject: [PATCH] clippy --- crates/nu-command/src/viewers/griddle.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/nu-command/src/viewers/griddle.rs b/crates/nu-command/src/viewers/griddle.rs index e7c0cc0d19..4d5c7fb1cd 100644 --- a/crates/nu-command/src/viewers/griddle.rs +++ b/crates/nu-command/src/viewers/griddle.rs @@ -8,7 +8,7 @@ use nu_engine::CallExt; use nu_protocol::{ ast::{Call, PathMember}, engine::{Command, EvaluationContext}, - Example, ShellError, Signature, Span, Spanned, SyntaxShape, Value, + Signature, Span, SyntaxShape, Value, }; use terminal_size::{Height, Width}; @@ -81,17 +81,17 @@ impl Command for Griddle { }); for h in data { - let a_string = format!("{}", &h[1]); // bytes ->, &h[3]); + let a_string = (&h[1]).to_string(); // bytes ->, &h[3]); let mut cell = Cell::from(a_string); cell.alignment = Alignment::Right; grid.add(cell); } let cols = if let Some(col) = columns { - col.parse::().unwrap() + col.parse::().unwrap_or(80) } else { // 80usize - if let Some((Width(w), Height(h))) = terminal_size::terminal_size() { + if let Some((Width(w), Height(_h))) = terminal_size::terminal_size() { w } else { 80u16 @@ -122,7 +122,9 @@ impl Command for Griddle { Ok(Value::Nothing { span: call.head }) } } - Value::Record { cols, vals, .. } => { + Value::Record { + cols: _, vals: _, .. + } => { // let mut output = vec![]; // for (c, v) in cols.into_iter().zip(vals.into_iter()) {