Skip to content

Commit

Permalink
Fix rust 1.70 lints (#2990)
Browse files Browse the repository at this point in the history
  • Loading branch information
raskad committed Jun 1, 2023
1 parent 5794555 commit 9367ee2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
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

0 comments on commit 9367ee2

Please sign in to comment.