Skip to content

Commit

Permalink
Rustfmt and clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nekevss committed Oct 14, 2022
1 parent 6299902 commit fcc0fa9
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 47 deletions.
8 changes: 3 additions & 5 deletions boa_engine/src/vm/opcode/binary_ops/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use crate::{
vm::{opcode::Operation, ShouldExit},
Context, JsResult, JsValue,
Context, JsResult,
};

pub(crate) mod macro_defined;
pub(crate) mod logical;
pub(crate) mod macro_defined;

pub(crate) use macro_defined::*;
pub(crate) use logical::*;

pub(crate) use macro_defined::*;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub(crate) struct NotEq;
Expand Down Expand Up @@ -96,4 +95,3 @@ impl Operation for InstanceOf {
Ok(ShouldExit::False)
}
}

1 change: 0 additions & 1 deletion boa_engine/src/vm/opcode/define/class/getter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ impl Operation for DefineClassGetterByValue {
Ok(ShouldExit::False)
}
}

1 change: 0 additions & 1 deletion boa_engine/src/vm/opcode/define/class/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ impl Operation for DefineClassMethodByValue {
Ok(ShouldExit::False)
}
}

7 changes: 3 additions & 4 deletions boa_engine/src/vm/opcode/define/class/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

pub(crate) mod method;
pub(crate) mod getter;
pub(crate) mod method;
pub(crate) mod setter;

pub(crate) use method::*;
pub(crate) use getter::*;
pub(crate) use setter::*;
pub(crate) use method::*;
pub(crate) use setter::*;
2 changes: 1 addition & 1 deletion boa_engine/src/vm/opcode/define/class/setter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ impl Operation for DefineClassSetterByValue {
)?;
Ok(ShouldExit::False)
}
}
}
3 changes: 1 addition & 2 deletions boa_engine/src/vm/opcode/generator/yield_stm.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
vm::{opcode::Operation, ShouldExit},
Context, JsResult
Context, JsResult,
};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
Expand All @@ -14,4 +14,3 @@ impl Operation for Yield {
Ok(ShouldExit::Yield)
}
}

2 changes: 1 addition & 1 deletion boa_engine/src/vm/opcode/iteration/loop_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ impl Operation for LoopEnd {
context.vm.frame_mut().try_env_stack_loop_dec();
Ok(ShouldExit::False)
}
}
}
3 changes: 0 additions & 3 deletions boa_engine/src/vm/opcode/iteration/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


pub(crate) mod for_await;
pub(crate) mod for_in;
pub(crate) mod init;
Expand All @@ -11,4 +9,3 @@ pub(crate) use for_in::*;
pub(crate) use init::*;
pub(crate) use iterator::*;
pub(crate) use loop_ops::*;

20 changes: 10 additions & 10 deletions boa_engine/src/vm/opcode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use crate::{vm::ShouldExit, Context, JsResult};

// Operation modules
pub(crate) mod await_stm;
pub(crate) mod binary_ops;
pub(crate) mod call;
pub(crate) mod concat;
pub(crate) mod to;
pub(crate) mod copy;
pub(crate) mod define;
pub(crate) mod delete;
Expand All @@ -14,7 +14,9 @@ pub(crate) mod environment;
pub(crate) mod generator;
pub(crate) mod get;
pub(crate) mod iteration;
pub(crate) mod jump;
pub(crate) mod new;
pub(crate) mod nop;
pub(crate) mod pop;
pub(crate) mod promise;
pub(crate) mod push;
Expand All @@ -25,19 +27,17 @@ pub(crate) mod set;
pub(crate) mod swap;
pub(crate) mod switch;
pub(crate) mod throw;
pub(crate) mod to;
pub(crate) mod try_catch;
pub(crate) mod value;
pub(crate) mod jump;
pub(crate) mod binary_ops;
pub(crate) mod unary_ops;
pub(crate) mod nop;
pub(crate) mod value;
pub(crate) mod void;

// Operation structs
pub(crate) use await_stm::*;
pub(crate) use binary_ops::*;
pub(crate) use call::*;
pub(crate) use concat::*;
pub(crate) use to::*;
pub(crate) use copy::*;
pub(crate) use define::*;
pub(crate) use delete::*;
Expand All @@ -46,7 +46,9 @@ pub(crate) use environment::*;
pub(crate) use generator::*;
pub(crate) use get::*;
pub(crate) use iteration::*;
pub(crate) use jump::*;
pub(crate) use new::*;
pub(crate) use nop::*;
pub(crate) use pop::*;
pub(crate) use promise::*;
pub(crate) use push::*;
Expand All @@ -57,12 +59,10 @@ pub(crate) use set::*;
pub(crate) use swap::*;
pub(crate) use switch::*;
pub(crate) use throw::*;
pub(crate) use to::*;
pub(crate) use try_catch::*;
pub(crate) use value::*;
pub(crate) use jump::*;
pub(crate) use binary_ops::*;
pub(crate) use unary_ops::*;
pub(crate) use nop::*;
pub(crate) use value::*;
pub(crate) use void::*;

pub(crate) trait Operation {
Expand Down
4 changes: 2 additions & 2 deletions boa_engine/src/vm/opcode/nop/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
vm::{opcode::Operation, ShouldExit},
Context, JsResult, JsValue,
Context, JsResult,
};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
Expand All @@ -13,4 +13,4 @@ impl Operation for Nop {
fn execute(_context: &mut Context) -> JsResult<ShouldExit> {
Ok(ShouldExit::False)
}
}
}
7 changes: 3 additions & 4 deletions boa_engine/src/vm/opcode/push/class/field.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::{
builtins::function::{ConstructorKind, Function},
object::{JsFunction, PrivateElement},
object::JsFunction,
vm::{opcode::Operation, ShouldExit},
Context, JsResult, JsValue,
Context, JsResult,
};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
Expand Down Expand Up @@ -75,4 +74,4 @@ impl Operation for PushClassFieldPrivate {
);
Ok(ShouldExit::False)
}
}
}
4 changes: 1 addition & 3 deletions boa_engine/src/vm/opcode/push/class/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
use crate::{
builtins::function::{ConstructorKind, Function},
object::{JsFunction, PrivateElement},
vm::{opcode::Operation, ShouldExit},
Context, JsResult, JsValue,
};

pub(crate) mod field;
pub(crate) mod private;

pub(crate) use private::*;
pub(crate) use field::*;
pub(crate) use private::*;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub(crate) struct PushClassPrototype;
Expand Down Expand Up @@ -55,4 +54,3 @@ impl Operation for PushClassPrototype {
}
}
}

7 changes: 3 additions & 4 deletions boa_engine/src/vm/opcode/push/class/private.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::{
builtins::function::{ConstructorKind, Function},
object::{JsFunction, PrivateElement},
object::PrivateElement,
vm::{opcode::Operation, ShouldExit},
Context, JsResult, JsValue,
Context, JsResult,
};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
Expand Down Expand Up @@ -87,4 +86,4 @@ impl Operation for PushClassPrivateSetter {
);
Ok(ShouldExit::False)
}
}
}
9 changes: 4 additions & 5 deletions boa_engine/src/vm/opcode/unary_ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ use crate::{
builtins::Number,
value::Numeric,
vm::{opcode::Operation, ShouldExit},
Context, JsBigInt, JsResult,
Context, JsBigInt, JsResult,
};
use std::ops::Neg as StdNeg;

pub(crate) mod increment;
pub(crate) mod decrement;
pub(crate) mod increment;

pub(crate) use increment::*;
pub(crate) use decrement::*;
pub(crate) use increment::*;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub(crate) struct TypeOf;
Expand All @@ -26,7 +26,6 @@ impl Operation for TypeOf {
}
}


#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub(crate) struct Pos;

Expand Down Expand Up @@ -74,4 +73,4 @@ impl Operation for BitNot {
}
Ok(ShouldExit::False)
}
}
}
2 changes: 1 addition & 1 deletion boa_engine/src/vm/opcode/void/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ impl Operation for Void {
context.vm.push(JsValue::undefined());
Ok(ShouldExit::False)
}
}
}

0 comments on commit fcc0fa9

Please sign in to comment.