Skip to content

Commit

Permalink
Fix 1.71.0 lints (#3140)
Browse files Browse the repository at this point in the history
* Fix 1.71.0 lints

* Attest suggestion
  • Loading branch information
RageKnify authored Jul 13, 2023
1 parent e1a2bb2 commit 93d05bd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion boa_engine/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl<'host> Context<'host> {
///
/// Note that this won't run any scheduled promise jobs; you need to call [`Context::run_jobs`]
/// on the context or [`JobQueue::run_jobs`] on the provided queue to run them.
#[allow(clippy::unit_arg, clippy::drop_copy)]
#[allow(clippy::unit_arg, dropping_copy_types)]
pub fn eval<R: Read>(&mut self, src: Source<'_, R>) -> JsResult<JsValue> {
let main_timer = Profiler::global().start_event("Script evaluation", "Main");

Expand Down
2 changes: 1 addition & 1 deletion boa_engine/src/module/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ impl Module {
///
/// assert_eq!(promise.state().unwrap(), PromiseState::Fulfilled(JsValue::undefined()));
/// ```
#[allow(clippy::drop_copy)]
#[allow(dropping_copy_types)]
#[inline]
pub fn load_link_evaluate(&self, context: &mut Context<'_>) -> JsResult<JsPromise> {
let main_timer = Profiler::global().start_event("Module evaluation", "Main");
Expand Down
5 changes: 1 addition & 4 deletions boa_engine/src/object/builtins/jsdataview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ impl JsDataView {
.into());
}

let view_byte_length = if let Some(..) = byte_length {
// Get the provided length
let provided_length = byte_length.expect("byte_length must be a u64");

let view_byte_length = if let Some(provided_length) = byte_length {
// Check that the provided length and offset does not exceed the bounds of the ArrayBuffer
if provided_offset + provided_length > array_buffer_length {
return Err(JsNativeError::range()
Expand Down
4 changes: 2 additions & 2 deletions boa_examples/src/bin/modulehandler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ fn require(_: &JsValue, args: &[JsValue], ctx: &mut Context<'_>) -> JsResult<JsV
// Read the module source file
println!("Loading: {libfile}");
let buffer = read_to_string(libfile);
if let Err(..) = buffer {
println!("Error: {}", buffer.unwrap_err());
if let Err(error) = buffer {
println!("Error: {error}");
Ok(JsValue::Rational(-1.0))
} else {
// Load and parse the module source
Expand Down

0 comments on commit 93d05bd

Please sign in to comment.