pub struct JsPeephole;Expand description
Simple peephole optimizations on JsExpr.
Implementations§
Source§impl JsPeephole
impl JsPeephole
Sourcepub fn fold_arith(expr: &JsExpr) -> JsExpr
pub fn fold_arith(expr: &JsExpr) -> JsExpr
Fold constant arithmetic on numeric literals.
Sourcepub fn simplify_identity(expr: &JsExpr) -> JsExpr
pub fn simplify_identity(expr: &JsExpr) -> JsExpr
Simplify x === x → true.
Sourcepub fn simplify_not(expr: &JsExpr) -> JsExpr
pub fn simplify_not(expr: &JsExpr) -> JsExpr
Simplify !true → false, !false → true.
Auto Trait Implementations§
impl Freeze for JsPeephole
impl RefUnwindSafe for JsPeephole
impl Send for JsPeephole
impl Sync for JsPeephole
impl Unpin for JsPeephole
impl UnsafeUnpin for JsPeephole
impl UnwindSafe for JsPeephole
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more