Skip to content

Commit 87a2783

Browse files
committed
Fix clippy warnings and formatting
1 parent cb6e46f commit 87a2783

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

rust/spirv-tools-core/src/assembly/assembler/tests.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,9 @@ fn constant_negative_float_text_for_float32_encodes_correctly() {
18281828
"%float = OpTypeFloat 32",
18291829
"%c = OpConstant %float -3.14",
18301830
]);
1831-
assert_eq!(operand, dr::Operand::LiteralBit32((-3.14_f32).to_bits()));
1831+
#[allow(clippy::approx_constant)]
1832+
let expected_bits = (-3.14_f32).to_bits();
1833+
assert_eq!(operand, dr::Operand::LiteralBit32(expected_bits));
18321834
}
18331835

18341836
#[test]
@@ -2110,7 +2112,8 @@ fn translator_emits_type_image_with_all_dims() {
21102112
.map(|line| parse_instruction(line).expect("parse"))
21112113
.collect();
21122114
let refs: Vec<_> = parsed.iter().collect();
2113-
let module = assemble_instructions(&refs).expect(&format!("assemble with Dim {dim_str}"));
2115+
let module =
2116+
assemble_instructions(&refs).unwrap_or_else(|_| panic!("assemble with Dim {dim_str}"));
21142117
let img_inst = module
21152118
.types_global_values
21162119
.iter()

rust/spirv-tools-core/src/validation/tests/versions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ fn image_operands_make_texel_visible_requires_vulkan_memory_model_capability() {
765765
let int_0 = builder.constant_bit32(int, 0);
766766
let float_0 = builder.constant_bit32(float, 0.0f32.to_bits());
767767
let coord = builder.constant_composite(v2int, [int_0, int_0]);
768-
let texel = builder.constant_composite(v4float, [float_0, float_0, float_0, float_0]);
768+
let _texel = builder.constant_composite(v4float, [float_0, float_0, float_0, float_0]);
769769
let img = builder.variable(
770770
ptr,
771771
None,
@@ -845,7 +845,7 @@ fn image_operands_make_texel_visible_allows_vulkan_memory_model_capability() {
845845
let int_0 = builder.constant_bit32(int, 0);
846846
let float_0 = builder.constant_bit32(float, 0.0f32.to_bits());
847847
let coord = builder.constant_composite(v2int, [int_0, int_0]);
848-
let texel = builder.constant_composite(v4float, [float_0, float_0, float_0, float_0]);
848+
let _texel = builder.constant_composite(v4float, [float_0, float_0, float_0, float_0]);
849849
let img = builder.variable(
850850
ptr,
851851
None,

0 commit comments

Comments
 (0)