Skip to content

Commit 2349a41

Browse files
committed
const folding: fix clippy
1 parent fa7e48f commit 2349a41

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,11 +3072,9 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
30723072
assert_ty_eq!(self, then_val.ty, else_val.ty);
30733073
let result_type = then_val.ty;
30743074

3075-
if let Some(const_cond) = self.try_get_const_value(cond) {
3076-
if let ConstValue::Bool(b) = const_cond {
3077-
// as we directly return the values, it'll preserve their constness as well
3078-
return if b { then_val } else { else_val };
3079-
}
3075+
if let Some(ConstValue::Bool(b)) = self.try_get_const_value(cond) {
3076+
// as we directly return the values, it'll preserve their constness as well
3077+
return if b { then_val } else { else_val };
30803078
}
30813079

30823080
self.emit()

0 commit comments

Comments
 (0)