Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rust 1.70 lints #2990

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions boa_engine/src/bytecompiler/statement/continue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ impl ByteCompiler<'_, '_> {
if let Some(node_label) = node.label() {
let items = self.jump_info.iter().rev().filter(|info| info.is_loop());
let mut emit_for_of_in_exit = 0_u32;
let mut loop_info = None;
for info in items {
if info.label() == Some(node_label) {
loop_info = Some(info);
break;
}

Expand All @@ -31,8 +29,6 @@ impl ByteCompiler<'_, '_> {
}
}

loop_info.expect("Cannot use the undeclared label");

for _ in 0..emit_for_of_in_exit {
self.emit_opcode(Opcode::Pop);
self.emit_opcode(Opcode::Pop);
Expand Down Expand Up @@ -88,10 +84,8 @@ impl ByteCompiler<'_, '_> {
} else if let Some(node_label) = node.label() {
let items = self.jump_info.iter().rev().filter(|info| info.is_loop());
let mut emit_for_of_in_exit = 0_u32;
let mut loop_info = None;
for info in items {
if info.label() == Some(node_label) {
loop_info = Some(info);
break;
}

Expand All @@ -100,8 +94,6 @@ impl ByteCompiler<'_, '_> {
}
}

loop_info.expect("Cannot use the undeclared label");

for _ in 0..emit_for_of_in_exit {
self.emit_opcode(Opcode::Pop);
self.emit_opcode(Opcode::Pop);
Expand Down
2 changes: 2 additions & 0 deletions boa_engine/src/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,8 @@ impl ToStringEscaped for [u16] {
.collect()
}
}

#[allow(clippy::redundant_clone)]
#[cfg(test)]
mod tests {
use crate::tagged::UnwrappedTagged;
Expand Down
1 change: 1 addition & 0 deletions boa_engine/src/value/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ fn hash_value(value: &JsValue) -> u64 {
hasher.finish()
}

#[allow(clippy::redundant_clone)]
#[test]
fn hash_undefined() {
let value1 = JsValue::undefined();
Expand Down
2 changes: 1 addition & 1 deletion boa_engine/src/vm/opcode/rest_parameter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Operation for RestParameterInit {
for _ in 0..rest_count {
args.push(context.vm.pop());
}
let array: _ = Array::create_array_from_list(args, context);
let array = Array::create_array_from_list(args, context);

context.vm.push(array);
} else {
Expand Down