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

[Merged by Bors] - Fix rust 1.60 clippy lints #2014

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boa_engine/src/builtins/array_buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ pub fn create_byte_data_block(size: usize, context: &mut Context) -> JsResult<Ve
///
/// [spec]: https://tc39.es/ecma262/#sec-copydatablockbytes
fn copy_data_block_bytes(
to_block: &mut Vec<u8>,
to_block: &mut [u8],
mut to_index: usize,
from_block: &[u8],
mut from_index: usize,
Expand Down
8 changes: 6 additions & 2 deletions boa_engine/src/builtins/regexp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,9 @@ impl RegExp {
// the substring of S from nextSourcePosition to position, and replacement.
accumulated_result = format!(
"{accumulated_result}{}{replacement}",
arg_str.get(next_source_position..position).unwrap(),
arg_str
.get(next_source_position..position)
.expect("index of a regexp match cannot be greater than the input string"),
)
.into();

Expand All @@ -1404,7 +1406,9 @@ impl RegExp {
Ok(format!(
"{}{}",
accumulated_result,
arg_str.get(next_source_position..).unwrap()
arg_str
.get(next_source_position..)
.expect("next_source_position cannot be greater than the input string")
)
.into())
}
Expand Down
3 changes: 1 addition & 2 deletions boa_engine/src/value/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ pub(crate) fn log_string_from(x: &JsValue, print_internals: bool, print_children
.borrow()
.properties()
.get(&PropertyKey::from("length"))
// TODO: do this in a better way `unwrap`
.unwrap()
.expect("array object must have 'length' property")
// FIXME: handle accessor descriptors
.expect_value()
.as_number()
Expand Down