Skip to content

Commit 8ad3876

Browse files
committed
run clippy
1 parent 9cb92f5 commit 8ad3876

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/ps/loops.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ impl<'a> RuleMut<'a> for ForStatementCondition {
6666
node: &mut crate::tree::NodeMut<'a, Self::Language>,
6767
_flow: crate::tree::ControlFlow,
6868
) -> crate::error::MinusOneResult<()> {
69-
if matches!(node.view().kind(), "while_statement" | "for_statement") {
70-
if node.start_transaction().is_ok() {
71-
// Save the loop id to close the transaction
72-
self.loop_id = Some(node.id());
73-
}
69+
if matches!(node.view().kind(), "while_statement" | "for_statement")
70+
&& node.start_transaction().is_ok()
71+
{
72+
// Save the loop id to close the transaction
73+
self.loop_id = Some(node.id());
7474
}
7575

7676
Ok(())
@@ -161,7 +161,7 @@ impl<'a> RuleMut<'a> for ForStatementFlowControl {
161161
.unwrap()
162162
.iter()
163163
.skip_while(|n| n.id() != view.id())
164-
.map(|n| n.id().clone())
164+
.map(|n| n.id())
165165
.collect();
166166
for id in following_children_ids {
167167
node.set_by_node_id(id, Powershell::DeadCode);
@@ -184,7 +184,7 @@ impl<'a> RuleMut<'a> for ForStatementFlowControl {
184184
if let Some(iterator_variable) = self
185185
.iterators
186186
.iter_mut()
187-
.find(|n| n.name == view.text().unwrap().to_string())
187+
.find(|n| n.name == view.text().unwrap())
188188
{
189189
iterator_variable.references.push(node.id());
190190
}

src/ps/var.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use crate::regex::Regex;
55
use crate::rule::{Rule, RuleMut};
66
use crate::scope::ScopeManager;
77
use crate::tree::{BranchFlow, ControlFlow, Node, NodeMut};
8-
use std::any::Any;
98
use std::collections::{BTreeMap, HashMap};
109
use std::ops::Add;
1110

0 commit comments

Comments
 (0)