Skip to content

Commit 502d3e9

Browse files
committed
Fix clippy warnings and tests
1 parent 43e89c4 commit 502d3e9

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

core/src/bytecode/ast/compat.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,12 +1383,7 @@ impl<'ast> FromAst<Node<'ast>> for term::Term {
13831383
}
13841384
Node::Record(record) => {
13851385
let (data, dyn_fields) = (*record).to_mainline();
1386-
Term::RecRecord(
1387-
data,
1388-
record.includes.iter().cloned().collect(),
1389-
dyn_fields,
1390-
None,
1391-
)
1386+
Term::RecRecord(data, record.includes.to_vec(), dyn_fields, None)
13921387
}
13931388
Node::IfThenElse {
13941389
cond,

core/src/transform/free_vars.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ impl CollectFreeVars for RichTerm {
137137
let mut rec_fields: HashSet<Ident> =
138138
record.fields.keys().map(|id| id.ident()).collect();
139139
// `{include foo, [..]}` is defined to have the semantics of `let foo_ = foo in
140-
// {foo = foo_, [..]}`. Hence an include count both as a normal field definition and as a free variable of the record (for the
141-
// external `foo` to be plugged in).
140+
// {foo = foo_, [..]}`. Hence an include count both as a normal field definition
141+
// and as a free variable of the record (for the external `foo` to be plugged in).
142142
let includes_as_ident = includes.iter().map(|id| id.ident());
143143
rec_fields.extend(includes_as_ident.clone());
144144
free_vars.extend(includes_as_ident);
@@ -149,8 +149,6 @@ impl CollectFreeVars for RichTerm {
149149
dyn_fields: Vec::with_capacity(dyn_fields.len()),
150150
};
151151

152-
free_vars.extend(&rec_fields);
153-
154152
for (id, t) in record.fields.iter_mut() {
155153
fresh.clear();
156154

lsp/nls/src/position.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ impl<'ast> PositionLookup<'ast> {
218218
})
219219
}));
220220

221-
// We include the identifier happening as part of `include` statements.
222-
ident_ranges.extend(data.includes.iter().filter_map(|id| {
221+
// We include the identifier happening as part of `include` expressions.
222+
ident_ranges.extend(data.includes.iter().copied().filter_map(|id| {
223223
Some(Entry {
224224
range: id.pos.into_opt()?.to_range(),
225225
data: IdentData {

0 commit comments

Comments
 (0)