Skip to content

Commit

Permalink
cargo fmt + clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Apr 5, 2024
1 parent 0cead44 commit 0518b13
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ compile_error!("Boa requires a lock free `AtomicUsize` in order to work properly
extern crate self as boa_engine;
extern crate static_assertions as sa;

pub use boa_parser as parser;
pub use boa_ast as ast;
pub use boa_gc as gc;
pub use boa_interner as interner;
pub use boa_parser as parser;

pub mod bigint;
pub mod builtins;
Expand Down
2 changes: 1 addition & 1 deletion core/engine/src/module/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl ModuleLoader for SimpleModuleLoader {
fn register_module(&self, specifier: JsString, module: Module) {
let path = PathBuf::from(specifier.to_std_string_escaped());

self.insert(path, module)
self.insert(path, module);
}

fn get_module(&self, specifier: JsString) -> Option<Module> {
Expand Down
4 changes: 3 additions & 1 deletion tests/tester/src/exec/js262.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ fn sleep(_: &JsValue, args: &[JsValue], context: &mut Context) -> JsResult<JsVal
/// The `$262.agent.monotonicNow()` function.
#[allow(clippy::unnecessary_wraps)]
fn monotonic_now(_: &JsValue, _: &[JsValue], _: &mut Context) -> JsResult<JsValue> {
let clock = START.get().ok_or_else(|| JsNativeError::typ().with_message("could not get the monotonic clock"))?;
let clock = START
.get()
.ok_or_else(|| JsNativeError::typ().with_message("could not get the monotonic clock"))?;
Ok(JsValue::from(clock.elapsed().as_millis() as f64))
}

Expand Down
15 changes: 6 additions & 9 deletions tests/tester/src/exec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,10 @@ impl Test {

if verbosity > 2 {
println!(
"`{}`{}: result text",
"`{}`{}: result text\n{result_text}\n",
self.path.display(),
if strict { " (strict)" } else { "" },
);
println!("{}", result_text);
println!();
}

TestResult {
Expand Down Expand Up @@ -377,12 +375,11 @@ impl Test {
phase: Phase::Resolution,
error_type,
} => {
let ref mut context =
match self.create_context(harness, optimizer_options, console) {
Ok(r) => r,
Err(e) => return (false, e),
}
.0;
let context = &mut match self.create_context(harness, optimizer_options, console) {
Ok(r) => r,
Err(e) => return (false, e),
}
.0;

let module = match parse_module_and_register(source, &self.path, context) {
Ok(module) => module,
Expand Down

0 comments on commit 0518b13

Please sign in to comment.