Update clippy to check all features (#441)

* Update clippy to check all features

* Fix tests

* oops
This commit is contained in:
JT
2021-12-06 07:23:43 +13:00
committed by GitHub
parent 9548e5ef5b
commit fdde95f675
13 changed files with 33 additions and 17 deletions

View File

@ -1,4 +1,4 @@
use super::nu_dataframe::{Column, NuDataFrame};
use super::values::{Column, NuDataFrame};
use nu_protocol::{
ast::Call,
@ -103,7 +103,7 @@ fn command(
call: &Call,
input: PipelineData,
) -> Result<PipelineData, ShellError> {
let df = NuDataFrame::try_from_pipeline(input, call.head.clone())?;
let df = NuDataFrame::try_from_pipeline(input, call.head)?;
let names = ChunkedArray::<Utf8Type>::new_from_opt_slice(
"descriptor",

View File

@ -1,4 +1,4 @@
use super::nu_dataframe::{Column, NuDataFrame};
use super::values::{Column, NuDataFrame};
use nu_protocol::{
ast::Call,
engine::{Command, EngineState, Stack},
@ -60,7 +60,7 @@ fn command(
call: &Call,
input: PipelineData,
) -> Result<PipelineData, ShellError> {
let df = NuDataFrame::try_from_pipeline(input, call.head.clone())?;
let df = NuDataFrame::try_from_pipeline(input, call.head)?;
let mut dtypes: Vec<Value> = Vec::new();
let names: Vec<Value> = df
@ -76,12 +76,12 @@ fn command(
let dtype_str = dtype.to_string();
dtypes.push(Value::String {
val: dtype_str.into(),
val: dtype_str,
span: call.head,
});
Value::String {
val: v.to_string().into(),
val: v.to_string(),
span: call.head,
}
})

View File

@ -1,4 +1,4 @@
mod nu_dataframe;
mod values;
mod describe;
mod dtypes;

View File

@ -1,4 +1,4 @@
use super::nu_dataframe::NuDataFrame;
use super::values::NuDataFrame;
use nu_engine::CallExt;
use nu_protocol::{
ast::Call,

View File

@ -1,4 +1,4 @@
use super::nu_dataframe::{Column, NuDataFrame};
use super::values::{Column, NuDataFrame};
use nu_protocol::{
ast::Call,

View File

@ -531,6 +531,6 @@ pub fn from_parsed_columns(column_values: ColumnMap) -> Result<NuDataFrame, Shel
}
DataFrame::new(df_series)
.map(|df| NuDataFrame::new(df))
.map(NuDataFrame::new)
.map_err(|e| ShellError::LabeledError("Error creating dataframe".into(), e.to_string()))
}

View File

@ -242,6 +242,7 @@ fn rm_helper(call: &Call, args: RmArgs) -> Vec<Value> {
use std::io::Error;
result = if trash {
trash::delete(&f).map_err(|e: trash::Error| {
use std::io::ErrorKind;
Error::new(ErrorKind::Other, format!("{:?}", e))
})
} else if metadata.is_file() {