Skip to content

Commit e0292d1

Browse files
dundargoctjdevries
authored andcommitted
refactor: fix clippy suggestions
1 parent 1b5ede3 commit e0292d1

4 files changed

Lines changed: 7 additions & 12 deletions

File tree

crates/vim9-gen/src/call_expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ pub fn mutates(expr: &CallExpression, _data: &FunctionData) -> Option<VimFuncMut
6868

6969
"remove" => Some(VimFuncMutability {
7070
returned: None,
71-
modified_args: HashSet::from_iter(vec![0].into_iter()),
71+
modified_args: HashSet::from_iter(vec![0]),
7272
}),
7373

7474
"reverse" | "sort" | "filter" => Some(VimFuncMutability {
7575
returned: Some(0),
76-
modified_args: HashSet::from_iter(vec![0].into_iter()),
76+
modified_args: HashSet::from_iter(vec![0]),
7777
}),
7878
_ => None,
7979
},

crates/vim9-lexer/src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,15 @@ impl Debug for Span {
3838
}
3939
}
4040

41-
#[derive(Clone, PartialEq)]
41+
#[derive(Clone, PartialEq, Default)]
4242
pub enum TokenText<'a> {
4343
Slice(&'a [char]),
4444
Owned(String),
45+
#[default]
4546
Empty,
4647
}
4748

48-
impl Default for TokenText<'_> {
49-
fn default() -> Self {
50-
TokenText::Empty
51-
}
52-
}
49+
5350

5451
impl<'a> From<TokenText<'a>> for String {
5552
fn from(val: TokenText<'a>) -> Self {

crates/vim9-parser/src/cmds/cmd_if.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ impl IfCommand {
3838
"elseif".to_string(),
3939
"else".to_string(),
4040
"endif".to_string(),
41-
]
42-
.into_iter(),
41+
],
4342
);
4443

4544
Ok(ExCommand::If(IfCommand {

crates/vim9-parser/src/cmds/cmd_try.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ impl TryCommand {
2222
"catch".to_string(),
2323
"finally".to_string(),
2424
"endtry".to_string(),
25-
]
26-
.into_iter(),
25+
],
2726
);
2827

2928
Ok(ExCommand::Try(TryCommand {

0 commit comments

Comments
 (0)