mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 23:39:48 +02:00
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:
@@ -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",
|
||||
|
@@ -56,7 +56,7 @@ mod integration {
|
||||
plugin(&mut Inc::new())
|
||||
.args(CallStub::new().with_parameter("package.version").create())
|
||||
.setup(|plugin, _| {
|
||||
plugin.expect_field(column_path(&vec![string("package"), string("version")]))
|
||||
plugin.expect_field(column_path(&[string("package"), string("version")]))
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user