Move to using clippy (#1142)

* Clippy fixes

* Finish converting to use clippy

* fix warnings in new master

* fix windows

* fix windows

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
This commit is contained in:
Jonathan Turner
2019-12-31 20:36:08 +13:00
committed by GitHub
parent 8093612cac
commit 72838cc083
93 changed files with 754 additions and 852 deletions

View File

@ -16,6 +16,7 @@ pub enum SemVerAction {
Patch,
}
#[derive(Default)]
pub struct Inc {
pub field: Option<Tagged<ColumnPath>>,
pub error: Option<String>,
@ -23,12 +24,8 @@ pub struct Inc {
}
impl Inc {
pub fn new() -> Inc {
Inc {
field: None,
error: None,
action: None,
}
pub fn new() -> Self {
Default::default()
}
fn apply(&self, input: &str) -> Result<UntaggedValue, ShellError> {
@ -122,12 +119,11 @@ impl Inc {
);
let got = replace_for?;
let replacement = self.inc(got.clone())?;
let replacement = self.inc(got)?;
match value.replace_data_at_column_path(
&f,
replacement.value.clone().into_untagged_value(),
) {
match value
.replace_data_at_column_path(&f, replacement.value.into_untagged_value())
{
Some(v) => Ok(v),
None => Err(ShellError::labeled_error(
"inc could not find field to replace",