Browse Source

Fix rust 1.70 lints (#2990)

pull/2992/head
raskad 1 year ago committed by GitHub
parent
commit
9367ee24aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      boa_engine/src/bytecompiler/statement/continue.rs
  2. 2
      boa_engine/src/string/mod.rs
  3. 1
      boa_engine/src/value/tests.rs
  4. 2
      boa_engine/src/vm/opcode/rest_parameter/mod.rs

8
boa_engine/src/bytecompiler/statement/continue.rs

@ -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;
}
@ -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);
@ -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;
}
@ -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);

2
boa_engine/src/string/mod.rs

@ -909,6 +909,8 @@ impl ToStringEscaped for [u16] {
.collect()
}
}
#[allow(clippy::redundant_clone)]
#[cfg(test)]
mod tests {
use crate::tagged::UnwrappedTagged;

1
boa_engine/src/value/tests.rs

@ -95,6 +95,7 @@ fn hash_value(value: &JsValue) -> u64 {
hasher.finish()
}
#[allow(clippy::redundant_clone)]
#[test]
fn hash_undefined() {
let value1 = JsValue::undefined();

2
boa_engine/src/vm/opcode/rest_parameter/mod.rs

@ -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 {

Loading…
Cancel
Save