try_wrap_bool_rhs

Function try_wrap_bool_rhs 

Source
fn try_wrap_bool_rhs(rhs: &Expr, target_ty: WgslType, ctx: &mut WalkCtx<'_>)
Expand description

If rhs is a comparison / boolean operator and target_ty is a numeric float type, emit two zero-length edits to wrap the RHS in select(<zero>, <one>, <rhs>). Zero-length insertions don’t collide with inner edits emitted by other passes.