Browse Source

Rust 1.68 clippy fixes (#2646)

<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel necessary.
--->

This Pull Request addresses the broken `cargo clippy` lints that is currently causing CI to fail.
pull/2644/head
Kevin 2 years ago
parent
commit
9da07dce72
  1. 2
      boa_engine/src/builtins/map/ordered_map.rs
  2. 1
      boa_engine/src/object/internal_methods/integer_indexed.rs
  3. 2
      boa_engine/src/object/internal_methods/string.rs
  4. 2
      boa_parser/src/lexer/string.rs

2
boa_engine/src/builtins/map/ordered_map.rs

@ -16,7 +16,7 @@ enum MapKey {
}
// This ensures that a MapKey::Key(value) hashes to the same as value. The derived PartialEq implementation still holds.
#[allow(clippy::derive_hash_xor_eq)]
#[allow(clippy::derived_hash_with_manual_eq)]
impl Hash for MapKey {
fn hash<H: Hasher>(&self, state: &mut H) {
match self {

1
boa_engine/src/object/internal_methods/integer_indexed.rs

@ -225,7 +225,6 @@ pub(crate) fn integer_indexed_exotic_own_property_keys(
// a. For each integer i starting with 0 such that i < O.[[ArrayLength]], in ascending order, do
// i. Add ! ToString(𝔽(i)) as the last element of keys.
(0..inner.array_length())
.into_iter()
.map(|index| PropertyKey::Index(index as u32))
.collect()
};

2
boa_engine/src/object/internal_methods/string.rs

@ -102,7 +102,7 @@ pub(crate) fn string_exotic_own_property_keys(
// 5. For each integer i starting with 0 such that i < len, in ascending order, do
// a. Add ! ToString(𝔽(i)) as the last element of keys.
keys.extend((0..len).into_iter().map(Into::into));
keys.extend((0..len).map(Into::into));
// 6. For each own property key P of O such that P is an array index
// and ! ToIntegerOrInfinity(P) ≥ len, in ascending numeric index order, do

2
boa_parser/src/lexer/string.rs

@ -192,7 +192,7 @@ impl StringLiteral {
0x005C /* \ */ => Some((0x005C /* \ */, None)),
0x0030 /* 0 */ if cursor
.peek()?
.filter(|next_byte| (b'0'..=b'9').contains(next_byte))
.filter(u8::is_ascii_digit)
.is_none() =>
Some((0x0000 /* NULL */, None)),
0x0078 /* x */ => {

Loading…
Cancel
Save