about summary refs log tree commit diff
path: root/tests/codegen/binary-search-index-no-bound-check.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-31 12:18:57 +0000
committerbors <bors@rust-lang.org>2024-05-31 12:18:57 +0000
commit2a2c29aafa50bf6fe53d66b32070eba59f860ac3 (patch)
tree278b17527f858913de99475f1d9ecdc41d297f89 /tests/codegen/binary-search-index-no-bound-check.rs
parent99cb42c29641aee2cce6521e07960d4de93205c8 (diff)
parent0ea498aa9fc7ddf696d53fe961d30e63e4d38438 (diff)
downloadrust-2a2c29aafa50bf6fe53d66b32070eba59f860ac3.tar.gz
rust-2a2c29aafa50bf6fe53d66b32070eba59f860ac3.zip
Auto merge of #125759 - nnethercote:format-some-tests, r=GuillaumeGomez
Format some tests

There are more directories under `tests/` still to do, but this is enough for one PR.

r? `@GuillaumeGomez`
Diffstat (limited to 'tests/codegen/binary-search-index-no-bound-check.rs')
-rw-r--r--tests/codegen/binary-search-index-no-bound-check.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/codegen/binary-search-index-no-bound-check.rs b/tests/codegen/binary-search-index-no-bound-check.rs
index 96f6bb54b3f..a213c015a40 100644
--- a/tests/codegen/binary-search-index-no-bound-check.rs
+++ b/tests/codegen/binary-search-index-no-bound-check.rs
@@ -11,11 +11,7 @@ pub fn binary_search_index_no_bounds_check(s: &[u8]) -> u8 {
     // CHECK-NOT: slice_start_index_len_fail
     // CHECK-NOT: slice_end_index_len_fail
     // CHECK-NOT: panic_bounds_check
-    if let Ok(idx) = s.binary_search(&b'\\') {
-        s[idx]
-    } else {
-        42
-    }
+    if let Ok(idx) = s.binary_search(&b'\\') { s[idx] } else { 42 }
 }
 
 // Similarly, check that `partition_point` is known to return a valid fencepost.