Skip to content

Commit 0457e36

Browse files
committed
test: fix tests and clippy checks
1 parent fd0c29f commit 0457e36

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

crates/vim9-lexer/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'a> From<&TokenText<'a>> for String {
6565
}
6666
}
6767

68-
impl<'a> Debug for TokenText<'a> {
68+
impl Debug for TokenText<'_> {
6969
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7070
match self {
7171
TokenText::Slice(s) => {
@@ -77,7 +77,7 @@ impl<'a> Debug for TokenText<'a> {
7777
}
7878
}
7979

80-
impl<'a> Display for TokenText<'a> {
80+
impl Display for TokenText<'_> {
8181
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8282
write!(
8383
f,

crates/vim9-parser/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl Debug for TokenMeta {
3737
}
3838
}
3939

40-
impl<'a> From<Token<'a>> for TokenMeta {
40+
impl From<Token<'_>> for TokenMeta {
4141
fn from(t: Token) -> Self {
4242
Self {
4343
kind: t.kind,
@@ -46,7 +46,7 @@ impl<'a> From<Token<'a>> for TokenMeta {
4646
}
4747
}
4848

49-
impl<'a> From<&Token<'a>> for TokenMeta {
49+
impl From<&Token<'_>> for TokenMeta {
5050
fn from(t: &Token) -> Self {
5151
Self {
5252
kind: t.kind.clone(),
@@ -556,7 +556,7 @@ pub struct Literal {
556556
pub token: TokenOwned,
557557
}
558558

559-
impl<'a> TryFrom<Token<'a>> for Literal {
559+
impl TryFrom<Token<'_>> for Literal {
560560
type Error = anyhow::Error;
561561

562562
fn try_from(token: Token) -> Result<Self> {
@@ -2441,10 +2441,9 @@ impl<'a> Parser<'a> {
24412441
if *self.mode.borrow() == ParserMode::PreVim9Script
24422442
&& !self.command_match("vim9script")
24432443
&& !self.command_match("def")
2444+
&& self.command_match("let")
24442445
{
2445-
if self.command_match("let") {
2446-
return SharedCommand::parse(&self);
2447-
}
2446+
return SharedCommand::parse(self);
24482447
}
24492448

24502449
// If the line starts with a colon, then just skip over it.

0 commit comments

Comments
 (0)