Skip to content

Commit 6948bf7

Browse files
committed
Fix formatting issues caught by cargo fmt
1 parent 3950c08 commit 6948bf7

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6085,7 +6085,10 @@ OpFunctionEnd"#;
60856085
"%float = OpTypeFloat 32",
60866086
"%c = OpConstant %float 1000000",
60876087
]);
6088-
assert_eq!(operand, dr::Operand::LiteralBit32(1_000_000.0_f32.to_bits()));
6088+
assert_eq!(
6089+
operand,
6090+
dr::Operand::LiteralBit32(1_000_000.0_f32.to_bits())
6091+
);
60896092
}
60906093

60916094
#[test]
@@ -6325,10 +6328,7 @@ OpFunctionEnd"#;
63256328
let mut all_ids = std::collections::HashSet::new();
63266329
for function in &module.functions {
63276330
let func_id = function.def.as_ref().unwrap().result_id.unwrap();
6328-
assert!(
6329-
all_ids.insert(func_id),
6330-
"Duplicate function ID: {func_id}"
6331-
);
6331+
assert!(all_ids.insert(func_id), "Duplicate function ID: {func_id}");
63326332
for param in &function.parameters {
63336333
let param_id = param.result_id.unwrap();
63346334
assert!(
@@ -6339,10 +6339,7 @@ OpFunctionEnd"#;
63396339
for block in &function.blocks {
63406340
if let Some(label) = &block.label {
63416341
let label_id = label.result_id.unwrap();
6342-
assert!(
6343-
all_ids.insert(label_id),
6344-
"Duplicate label ID: {label_id}"
6345-
);
6342+
assert!(all_ids.insert(label_id), "Duplicate label ID: {label_id}");
63466343
}
63476344
}
63486345
}

rust/spirv-tools-core/src/assembly/parser.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,7 @@ impl<'a> Parser<'a> {
400400
OperandValue::Id(IdRef::new(id, span))
401401
}
402402
}
403-
OperandKind::LiteralInteger => {
404-
OperandValue::Literal(parse_integer(word, span)?)
405-
}
403+
OperandKind::LiteralInteger => OperandValue::Literal(parse_integer(word, span)?),
406404
OperandKind::LiteralContextDependentNumber => {
407405
// Context-dependent numbers may be integer or float text
408406
// depending on the result type (e.g. OpConstant %float 42.5).

rust/spirv-tools-opt/src/egglog_opt.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7736,10 +7736,7 @@ mod tests {
77367736
.unwrap();
77377737

77387738
let check = egraph.parse_and_run_program(None, "(check (= root expected))");
7739-
assert!(
7740-
check.is_ok(),
7741-
"Load after storing Undef should give Undef"
7742-
);
7739+
assert!(check.is_ok(), "Load after storing Undef should give Undef");
77437740
}
77447741

77457742
// =========================================================================
@@ -7765,7 +7762,10 @@ mod tests {
77657762
.unwrap();
77667763

77677764
let check = egraph.parse_and_run_program(None, "(check (= root expected))");
7768-
assert!(check.is_ok(), "Sym should be equivalent to LoopInvariant(Sym)");
7765+
assert!(
7766+
check.is_ok(),
7767+
"Sym should be equivalent to LoopInvariant(Sym)"
7768+
);
77697769
}
77707770

77717771
#[test]

0 commit comments

Comments
 (0)